Check is TScrollBox scrollbars are actually visible
Asked Answered
P

1

5

I have a simple sizable form with TScrollBox (Align := alClient) and some controls put on TScrollBox. If user change the form size, TScrollBox show and hide the HorzScrollBar and VertScrollBar (depend on actual client form size).

How to check at run-time - does HorzScrollBar or VertScrollBar are visible right now?

TControlScrollBar.Visible is not an answer, because it hase a regulating function only.

Pressey answered 18/9, 2015 at 6:3 Comment(0)
S
11

Use TControlScrollBar.IsScrollBarVisible to test this.

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

Spread answered 18/9, 2015 at 6:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.