This documentation is archived and is not being maintained.


Adds the supplied page with the rightmost tab in the property sheet.

void AddPage(
   CPropertyPage *pPage 



Points to the page to be added to the property sheet. Cannot be NULL.

Add pages to the property sheet in the left-to-right order you want them to appear.

AddPage adds the CPropertyPage object to the CPropertySheet object's list of pages but does not actually create the window for the page. The framework postpones creation of the window for the page until the user selects that page.

When you add a property page using AddPage, the CPropertySheet is the parent of the CPropertyPage. To gain access to the property sheet from the property page, call CWnd::GetParent.

It is not necessary to wait until creation of the property sheet window to call AddPage. Typically, you will call AddPage before calling DoModal or Create.

If you call AddPage after displaying the property page, the tab row will reflect the newly added page.

// Add two pages to a CPropertySheet object, then show the 
// CPropertySheet object as a modal dialog.  Both CStylePage 
// and CColorPage are CPropertyPage-derived classes created 
// by the Add Class wizard.  

CPropertySheet dlgPropertySheet("Simple PropertySheet");

CStylePage     stylePage;
CColorPage     colorPage;