# CWnd::EnableScrollBar

Visual Studio 2008

Enables or disables one or both arrows of a scroll bar.

```BOOL EnableScrollBar(
int nSBFlags,
UINT nArrowFlags = ESB_ENABLE_BOTH
);
```

## Parameters

nSBFlags

Specifies the scroll-bar type. Can have one of the following values:

• SB_BOTH   Enables or disables the arrows of the horizontal and vertical scroll bars associated with the window.

• SB_HORZ   Enables or disables the arrows of the horizontal scroll bar associated with the window.

• SB_VERT   Enables or disables the arrows of the vertical scroll bar associated with the window.

nArrowFlags

Specifies whether the scroll-bar arrows are enabled or disabled and which arrows are enabled or disabled. Can have one of the following values:

• ESB_ENABLE_BOTH   Enables both arrows of a scroll bar (default).

• ESB_DISABLE_LTUP   Disables the left arrow of a horizontal scroll bar or the up arrow of a vertical scroll bar.

• ESB_DISABLE_RTDN   Disables the right arrow of a horizontal scroll bar or the down arrow of a vertical scroll bar.

• ESB_DISABLE_BOTH   Disables both arrows of a scroll bar.

## Return Value

Nonzero if the arrows are enabled or disabled as specified. Otherwise it is 0, which indicates that the arrows are already in the requested state or that an error occurred.