IScrollBars.ScrollBars

Syntax

ScrollBars: ControlScrollStyle;

Description

The ScrollBars property returns a value that indicates that the component has scrollbars.

Example

Sub ScrollsInfo(Control: IControl);
Var
    Scrolls: IScrollBars;
Begin
    Scrolls := Control.Scrolls;
    Select Case Scrolls.ScrollBars
        Case ControlScrollStyle.None:
            Debug.WriteLine("Component has not scrollbar.");
        Case ControlScrollStyle.Horizontal:
            Debug.WriteLine("Horizontal scrollbar:");
            WriteScrollInfo(Scrolls.HScrollInfo);
        Case ControlScrollStyle.Vertical:
            Debug.WriteLine("Vertical scrollbar:");
            WriteScrollInfo(Scrolls.VScrollInfo);
        Case ControlScrollStyle.Both:
            Debug.WriteLine("Horizontal scrollbar:");
            WriteScrollInfo(Scrolls.HScrollInfo);
            Debug.WriteLine("Vertical scrollbar:");
            WriteScrollInfo(Scrolls.VScrollInfo);
    End Select;
End Sub ScrollsInfo;

Sub WriteScrollInfo(Info: IScrollInfo);
Begin
    Debug.WriteLine("Minimum position: " + Info.Min.ToString);
    Debug.WriteLine("Maximum position: " + Info.Max.ToString);
    Debug.WriteLine("Page size: " + Info.Page.ToString);
    Debug.WriteLine("Current slider position: " + Info.Pos.ToString);
End Sub WriteScrollInfo;

The ScrollsInfo procedure enables the user to get information about scrollbars of the component that is passed as the Control input parameter. Information about scrollbars is displayed in the development environment console.

See also:

IScrollBars