Skip to content

ScrollBarVisibility

Summary

Specifies the visibility of a ScrollBar for scrollable content.

Signature

1
public enum ScrollBarVisibility

Namespace

cAlgo.API

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
 using cAlgo.API;
 namespace cAlgo
 {
     // This sample shows how to use the ScrollBarVisibility
     [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
     public class ScrollBarVisibilitySample : Indicator
     {
         [Parameter("Horizontal Scroll Bar Visibility", DefaultValue = ScrollBarVisibility.Auto)]
         public ScrollBarVisibility HorizontalScrollBarVisibility { get; set; }
         [Parameter("Vertical Scroll Bar Visibility", DefaultValue = ScrollBarVisibility.Visible)]
         public ScrollBarVisibility VerticalScrollBarVisibility { get; set; }
         protected override void Initialize()
         {
             var scrollViewer = new ScrollViewer
             {
                 HorizontalAlignment = HorizontalAlignment.Center,
                 VerticalAlignment = VerticalAlignment.Center,
                 BackgroundColor = Color.Gold,
                 Opacity = 0.7,
                 HorizontalScrollBarVisibility = HorizontalScrollBarVisibility,
                 VerticalScrollBarVisibility = VerticalScrollBarVisibility,
                 Height = 100
             };
             var grid = new Grid(10, 2)
             {
                 BackgroundColor = Color.Gold,
                 HorizontalAlignment = HorizontalAlignment.Center,
                 VerticalAlignment = VerticalAlignment.Center,
             };
             scrollViewer.Content = grid;
             for (int iRow = 0; iRow < 10; iRow++)
             {
                 grid.AddChild(new TextBlock
                 {
                     Text = "Text",
                     Margin = 5,
                     ForegroundColor = Color.Black,
                     FontWeight = FontWeight.ExtraBold
                 }, iRow, 0);
                 grid.AddChild(new Button
                 {
                     Text = "Button",
                     Margin = 5,
                     ForegroundColor = Color.Black,
                     FontWeight = FontWeight.ExtraBold
                 }, iRow, 1);
             }
             Chart.AddControl(scrollViewer);
         }
         public override void Calculate(int index)
         {
         }
     }
 }

See Also

Fields

Disabled

Summary

A ScrollBar does not appear even when the viewport cannot display all of the content.

Signature

1
public static ScrollBarVisibility Disabled;

Return Value

ScrollBarVisibility

Auto

Summary

A ScrollBar appears and the dimension of the ScrollViewer is applied to the content when the viewport cannot display all of the content.

Signature

1
public static ScrollBarVisibility Auto;

Return Value

ScrollBarVisibility

Hidden

Summary

A ScrollBar does not appear even when the viewport cannot display all of the content. The dimension of the ScrollViewer is not applied to the content.

Signature

1
public static ScrollBarVisibility Hidden;

Return Value

ScrollBarVisibility

Visible

Summary

A ScrollBar always appears. The dimension of the ScrollViewer is applied to the content.

Signature

1
public static ScrollBarVisibility Visible;

Return Value

ScrollBarVisibility