CPropertySheet::AddPage

添加具有最右侧的选项卡上提供的页在属性表。

void AddPage(
   CPropertyPage *pPage 
);

参数

  • pPage
    指向要添加的页到特性表。 不能为 NULL

备注

页添加到特性表按希望它们的出现从左到右的顺序。

AddPage 添加到 CPropertySheetCPropertyPage 对象对象列表页,但并不实际创建页的窗口。 框架推迟窗口中创建该页,直到用户选择该页。

使用 AddPage时,添加属性页,CPropertySheetCPropertyPage的父级。 若要从属性页的属性表若要访问,请调用 CWnd::GetParent

等待属性表窗口中创建一个名为 AddPage并不是必需的。 通常,在调用 DoModal创建前调用 AddPage

如果在显示属性页之后调用 AddPage,选项行将反映新添加的页。

示例

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

CPropertySheet dlgPropertySheet(_T("Simple PropertySheet"));

CStylePage     stylePage;
CColorPage     colorPage;
CShapePage     shapePage;
dlgPropertySheet.AddPage(&stylePage);
dlgPropertySheet.AddPage(&colorPage);
dlgPropertySheet.AddPage(&shapePage);

dlgPropertySheet.DoModal();

要求

Header: afxdlgs.h

请参见

参考

CPropertySheet选件类

层次结构图

CPropertySheet::RemovePage