C #: How to determine if a ScrollBar is currently being displayed for a scrollable item?

Is there a way to check if the scroll bar is displayed for the control or not? I want to use it so that I can determine how to determine the size of the scrollable control, which to some extent depends on whether the ScrollBar is displayed (the Scrollable control can change dynamically).

+3
source share
1 answer

For controls with the AutoScroll property, use the HorizontalScroll and VerticalScroll Visible properties:

// Checks horizontal scrollbar visibity.
yourScrollableControl.HorizontalScroll.Visible;

// Checks horizontal scrollbar visibity.
yourScrollableControl.VerticalScroll.Visible;
+9
source

Source: https://habr.com/ru/post/1720520/


All Articles