[MFC] Notes for using CScrollView

Source: Internet
Author: User

CScrollView is generally used in the document view structure, which can contain pictures, tables, etc.

However, we often get confused when we start to use it.

For example, how to set the size? We know where to call SetScrollSizes? I used to call both OnInitialUpdate and OnUpdate to initialize an appropriate size in OnInitialUpdate (because SetScrollSizes is very fragile, an error occurs if the value is less than or equal to 0 ), then, adjust the View size when you open the image, that is, find the image size in OnUpdate and set it later.

I am confused about the running results, and the size has not changed! Later, it was found that OnUpdate was called by default in OnInitialUpdate, so it was changed in OnUpdate and then changed back. The effect was that SetScrollSizes in OnUpdate didn't seem to work at all.

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.