다음을 통해 공유


CView::OnScrollBy

Called by the framework when the user views an area beyond the present view of the document, either by dragging an OLE item against the view's current borders or by manipulating the vertical or horizontal scrollbars.

virtual BOOL OnScrollBy(
   CSize sizeScroll,
   BOOL bDoScroll = TRUE 
);

Parameters

  • sizeScroll
    Number of pixels scrolled horizontally and vertically.

  • bDoScroll
    Determines whether scrolling of the view occurs. If TRUE, then scrolling takes place; if FALSE, then scrolling does not occur.

Return Value

Nonzero if the view was able to be scrolled; otherwise 0.

Remarks

In derived classes this method checks to see whether the view is scrollable in the direction the user requested and then updates the new region if necessary. This function is automatically called by CWnd::OnHScroll and CWnd::OnVScroll to perform the actual scrolling request.

The default implementation of this method does not change the view, but if it is not called, the view will not scroll in a CScrollView-derived class.

If the document width or height exceeds 32767 pixels, scrolling past 32767 will fail because OnScrollBy is called with an invalid sizeScroll argument.

Requirements

Header: afxwin.h

See Also

Concepts

CView Class

CView Members

Hierarchy Chart