Collapse the table of content
Expand the table of content
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer


Call this member function to obtain a pointer to the specified sibling scroll bar or splitter window.

virtual CScrollBar* GetScrollBarCtrl(
   int nBar 
) const;



Specifies the type of scroll bar. The parameter can take one of the following values:

  • SB_HORZ   Retrieves the position of the horizontal scroll bar.

  • SB_VERT   Retrieves the position of the vertical scroll bar.

A sibling scroll-bar control, or NULL if none.

This member function does not operate on scroll bars created when the WS_HSCROLL or WS_VSCROLL bits are set during the creation of a window. The CWnd implementation of this function simply returns NULL. Derived classes, such as CView, implement the described functionality.

© 2015 Microsoft