Improvement on accel in MFC Windows Programming

Source: Internet
Author: User
 

There is a small problem with the accel program in Chapter 2, that is, when you move the scroll bar to a position, the size of the modified window will not save the current position, but return to the upper left corner of the window. This is not in line with our habits. The content in the upper left corner of the window remains unchanged no matter how the window changes. After carefully reading the accel program, you can modify it to implement this function.

The original program

Void cmainwindow: onsize (uint ntype, int CX, int CY) function returns the position of the flow entry to zero, which is the problem. This function does not change the position of the scroll bar to achieve the effect in this article. However, the original program only initializes "m_nhscrollpos" and "m_nvscrollpos" in this function, so we need to put the initialization work in the int cmainwindow: oncreate (lpcreatestruct) function.
 
Run the command after modification !!
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.