ScrollBarsproperty
Returns or sets a value that determines whether an MSHFlexGrid has horizontal and/or vertical scroll bars.
Syntax
PROPERTY ScrollBars () AS ScrollBarsSetting
PROPERTY ScrollBars (BYVAL settings AS ScrollBarsSettings)
Parameters
| Name | Description | |
|---|---|---|
settings | An integer or constant that specifies the type of scroll bars. |
Description
Returns or sets a value that determines whether an MSHFlexGrid has horizontal and/or vertical scroll bars.
Remarks
Even if set to flexScrollBarBoth, a scroll bar only physically appears if the content (total rows or columns) actually exceeds the grid's width or height.
If a scroll bar is set to "None" for a specific direction, the user cannot use the keyboard (arrow keys) to scroll to cells outside the visible area in that direction.
You can force the grid to scroll to a specific location via code regardless of the ScrollBars setting using these properties:
- TopRow: Sets or returns the index of the row displayed at the very top of the grid.
- LeftCol: Sets or returns the index of the column displayed at the leftmost side of the grid.
Important events
Scroll event: This event fires whenever the grid is scrolled, whether by the user interacting with the scroll bars or by code changing TopRow or LeftCol.
Detection workaround: There is no native "ScrollbarVisible" property. To detect if a scroll bar is currently visible, you can compare the sum of all RowHeight values against the control's height.
Reference
- Documented in Windows/Windows GUI/MSHFlexGrid Class.md
- Topic: Microsoft Hierarchical Grid