Check that the scrollbars of the TScrollBox are actually visible

I have a simple form with a TScrollBox ( Align := alClient ), and some controls on a TScrollBox. If the user resizes the form, the TScrollBox shows and hides the HorzScrollBar and VertScrollBar (depending on the size of the actual client form).

How to check at runtime - are HorzScrollBar or VertScrollBar visible right now?

TControlScrollBar.Visible not an answer because it has only a regulatory function.

+5
source share
1 answer

Use TControlScrollBar.IsScrollBarVisible to verify this.

Call IsScrollBarVisible to determine if the scrollbar is visible. IsScrollBarVisible returns true if the Visible property is true, and the associated scroll control contains child controls that lie within Margin pixels from the edge.

+8
source

All Articles