About the Property sheet dialog box steps

Source: Internet
Author: User

1. Each property page is associated with a class, such as two property pages, corresponding to 2 classes, cmypage1,cmypage2, and a function that overloads the CPropertyPage class.
2. Add a new class Cmysheet, using MFC's Class Wizard, inherit from CPropertySheet
3. Define two variables in Cmysheet, CMypage1 m_p1; CMypage2 M_P2, notice the introduction of the header file, declaring an object separately in the constructor.
4. In the Cmysheet constructor, add the following statement: AddPage (&M_P1); AddPage (&M_P2)
5. After the above steps, the CPropertySheet class is completed and called where needed. As an example:
Cmysheet M_sheet (_t ("Personal Data"));
M_sheet. DoModal ();
You can have it.

Note: About DoModal

The page is added to the attribute table in the order that you want them to appear from left to right.

AddPage Adds the CPropertyPage object object to the CPropertySheet list page, but does not actually create a window for the page. the framework defers creating the page in the window until the user selects the page.

when using   AddPage , add the property page, CPropertySheet   Yes   CPropertyPage The parent of the .  cwnd::getparent. " > To access the property sheet from the property page, call  cwnd::getparent.

It is not necessary to wait for the property sheet window to create a named AddPage . Typically, you call AddPagebefore calling DoModal or creating.

If you call AddPageafter the property page is displayed, the option line reflects the newly added page.

About the Property sheet dialog box steps

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.