ShowScrollBar function

The ShowScrollBar function shows or hides the specified scroll bar.

Syntax

BOOL ShowScrollBar(
  HWND hWnd,
  int  wBar,
  BOOL bShow
);

Parameters

hWnd

Type: HWND

Handle to a scroll bar control or a window with a standard scroll bar, depending on the value of the wBar parameter.

wBar

Type: int

Specifies the scroll bar(s) to be shown or hidden. This parameter can be one of the following values.

Value Meaning
SB_BOTH
Shows or hides a window's standard horizontal and vertical scroll bars.
SB_CTL
Shows or hides a scroll bar control. The hwnd parameter must be the handle to the scroll bar control.
SB_HORZ
Shows or hides a window's standard horizontal scroll bars.
SB_VERT
Shows or hides a window's standard vertical scroll bar.

bShow

Type: BOOL

Specifies whether the scroll bar is shown or hidden. If this parameter is TRUE, the scroll bar is shown; otherwise, it is hidden.

Return Value

Type: BOOL

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

You should not call this function to hide a scroll bar while processing a scroll bar message.

Requirements

   
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header winuser.h (include Windows.h)
Library User32.lib
DLL User32.dll

See Also

EnableScrollBar