Specifies whether a control, form, or page has vertical scroll bars, horizontal scroll bars, or both.
Syntax
object.ScrollBars [= fmScrollBars]
The ScrollBars property syntax has these parts:
Part | Description |
---|---|
object | Required. A valid object. |
fmScrollBars | Optional. Where scroll bars should be displayed. |
Settings
The settings for fmScrollBars are:
Constant | Value | Description |
---|---|---|
fmScrollBarsNone | 0 | Displays no scroll bars (default). |
fmScrollBarsHorizontal | 1 | Displays a horizontal scroll bar. |
fmScrollBarsVertical | 2 | Displays a vertical scroll bar. |
fmScrollBarsBoth | 3 | Displays both a horizontal and a vertical scroll bar. |
Remarks
If the KeepScrollBarsVisible property is True, any scroll bar on a form or page is always visible, regardless of whether the object's contents fit within the object's borders.
If visible, a scroll bar constrains its scroll box to the visible region of the scroll bar. It also modifies the scroll position as needed to keep the entire scroll bar visible. The range of a scroll bar changes when the value of the ScrollBars property changes, the scroll size changes, or the visible size changes.
If a scroll bar is not visible, then you can set its scroll position to any value. Negative values and values greater than the scroll size are both valid.
For a single-line control, you can display a horizontal scroll bar by using the ScrollBars and AutoSize properties. Scroll bars are hidden or displayed according to the following rules:
For a multiline TextBox, you can display scroll bars by using the ScrollBars, WordWrap, and AutoSize properties. Scroll bars are hidden or displayed according to the following rules: