CScrollBar Class

Provides the functionality of a Windows scroll-bar control.

class CScrollBar : public CWnd

Name

Description

CScrollBar::CScrollBar

Constructs a CScrollBar object.

Name

Description

CScrollBar::Create

Creates the Windows scroll bar and attaches it to the CScrollBar object.

CScrollBar::EnableScrollBar

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

CScrollBar::GetScrollBarInfo

Retrieves information about the scroll bar using a SCROLLBARINFO structure.

CScrollBar::GetScrollInfo

Retrieves information about the scroll bar.

CScrollBar::GetScrollLimit

Retrieves the limit of the scroll bar

CScrollBar::GetScrollPos

Retrieves the current position of a scroll box.

CScrollBar::GetScrollRange

Retrieves the current minimum and maximum scroll-bar positions for the given scroll bar.

CScrollBar::SetScrollInfo

Sets information about the scroll bar.

CScrollBar::SetScrollPos

Sets the current position of a scroll box.

CScrollBar::SetScrollRange

Sets minimum and maximum position values for the given scroll bar.

CScrollBar::ShowScrollBar

Shows or hides a scroll bar.

You create a scroll-bar control in two steps. First, call the constructor CScrollBar to construct the CScrollBar object, then call the Create member function to create the Windows scroll-bar control and attach it to the CScrollBar object.

If you create a CScrollBar object within a dialog box (through a dialog resource), the CScrollBar is automatically destroyed when the user closes the dialog box.

If you create a CScrollBar object within a window, you may also need to destroy it.

If you create the CScrollBar object on the stack, it is destroyed automatically. If you create the CScrollBar object on the heap by using the new function, you must call delete on the object to destroy it when the user terminates the Windows scroll bar.

If you allocate any memory in the CScrollBar object, override the CScrollBar destructor to dispose of the allocations.

For related information about using CScrollBar, see Controls.

Header: afxwin.h

Show: