CWnd::SetScrollRange

Syntax

void SetScrollRange( int nBar, int nMinPos, int nMaxPos, BOOL bRedraw = TRUE );

Parameters

nBar

Specifies the scroll bar to be set. It can be one of the following values:

Value Meaning

SB_CTL Sets the position of a scroll-bar control. In this case, the CWnd must be a scroll-bar control.
SB_HORZ Sets the CWnd horizontal scroll-bar position.
SB_VERT Sets the CWnd vertical scroll-bar position.

nMinPos

Specifies the minimum scrolling position.

nMaxPos

Specifies the maximum scrolling position.

bRedraw

Specifies whether or not the scroll bar should be redrawn to reflect the change. If bRedraw is TRUE, the scroll bar is redrawn; if FALSE, it is not redrawn.

Remarks

Sets minimum and maximum position values for the given scroll bar. It can also be used to hide or show standard scroll bars by setting nMinPos and nMaxPos to 0.

An application should not call this function to hide a scroll bar while processing a scroll-bar notification message.

If SetScrollRange immediately follows the SetScrollPos member function, the bRedraw parameter in the SetScrollPos member function should be set to FALSE to prevent the scroll bar from being drawn twice.

The difference between the values specified by nMinPos and nMaxPos must not be greater than 32,767.

See Also

CWnd::SetScrollPos, ::SetScrollRange, CWnd::GetScrollRange