Onvscroll (vertical) Same as onhscroll (horizontal)
Afx_msg void onvscroll (uint nsbcode, uint NPOs, cscrollbar * pscrollbar );
Parameter: nsbcode specifies a scroll bar indicating the user's rolling request.Code. This parameter can be one of the following values:
· Sb_bottom scroll to the bottom.
· Sb_endscroll ends the scroll.
· Sb_linedown: Scroll down a row.
· Sb_lineup: Scroll up a row.
· Sb_pagedown: Scroll down one page.
· Sb_pageup: Scroll up one page.
· Sb_thumbposition: scroll to an absolute position. The current position is specified in NPOs.
· Sb_thumbtrack: drag the scroll box to the specified position. The current position is specified in NPOs.
· Sb_top scroll to the top.
NPOs if the code of the scroll bar is sb_thumbposition or sb_thumbtrack, this parameter specifies the position of the scroll box; otherwise, this parameter is not used. According to the initial rolling range, NPOs may be a negative value. If necessary, it can be forcibly converted to an int value.
Pscrollbar if the scrolling information comes from a scroll bar control, this parameter points to the control pointer. If you click the scroll bar of a window, this parameter is null. The pointer may be temporary and cannot be saved for future use.
Note:
When you click the vertical scroll bar of the window, the Framework calls this member function.
Applications that require certain feedback when the scroll box is draggedProgramGenerally, the onvscroll function is used.
If onvscroll rolls the content of this cwnd object, you must call the setscrollpos member function to restore the position of the scroll bar.
Note that the Framework calls this member function so that your application can process a Windows message. The parameters passed to your function reflect the parameters received by the framework when the message is received. If you call the basic class implementation of this function, this implementation will use the parameters that are initially passed along with the message, rather than the parameters you provide to the function.