45.1.7 Scroll Bar Visibility

For a standard scroll bar, if the minimum and maximum scroll-range values are equal, the scroll bar is hidden and, in effect, disabled. This is the way to temporarily hide a scroll bar when it is not needed for the current contents of the client area.

The SetScrollRange function hides and disables a standard scroll bar when equal minimum and maximum values are specified. No scrolling requests can be made through the scroll bar when it is hidden. SetScrollRange enables the scroll bar and shows it again when it sets the minimum and maximum values to unequal values. The ShowScrollBar function can also be used to hide or show a scroll bar. It does not affect the scroll bar's range or scroll-box position.

You can disable a scroll bar without affecting the scroll bar's visibility by using the EnableScrollBar function. This function lets you disable one or both arrows of a scroll bar. Disabled arrows are grayed and do not respond to user input.