Returns or sets a value indicating whether an object has horizontal or vertical scroll bars. Read only at run time.
Syntax
object.ScrollBars
The object placeholder represents an object expression that evaluates to an object in the Applies To list.
Settings
For an MDIForm object, the ScrollBars property settings are:
Setting | Description |
True | (Default) The form has a horizontal or vertical scroll bar, or both. |
False | The form has no scroll bars. |
For a TextBox control, the ScrollBars property settings are:
Constant | Setting | Description |
vbSBNone | 0 | (Default) None |
vbHorizontal | 1 | Horizontal |
vbVertical | 2 | Vertical |
vbBoth | 3 | Both |
For a DataGrid control, the ScrollBars property settings are:
Constant | Setting | Description |
dbgNone | 0 | (Default) None |
dbgHorizontal | 1 | Horizontal |
dbgVertical | 2 | Vertical |
dbgBoth | 3 | Both |
dbgAutomatic | 4 | Automatic |
Remarks
For a TextBox control with setting 1 (Horizontal), 2 (Vertical), or 3 (Both), you must set the MultiLine property to True.
At run time, the Microsoft Windows operating environment automatically implements a standard keyboard interface to allow navigation in TextBox controls with the arrow keys (UP ARROW, DOWN ARROW, LEFT ARROW, and RIGHT ARROW), the HOME and END keys, and so on.
Scroll bars are displayed on an object only if its contents extend beyond the object's borders. For example, in an MDIForm object, if part of a child form is hidden behind the border of the parent MDI form, a horizontal scroll bar (HScrollBar control) is displayed. The exception to this is the TextBox control which will always display scroll bars. If ScrollBars is set to False, the object won't have scroll bars, regardless of its contents.