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