1.新建2个对话框IDD_DIALOG1和IDD_DIALOG2,在上面随便放点什么控件之类的;用向导为它们添加类CPage1和CPage2,基类都是CPropertyPage.
2.用向导添加新类CProSheet,基类为CPropertySheet,在ProSheet.h中加入
// ProSheet.h : header file
#include "Page1.h"
#include "Page2.h"
class CProSheet : public CPropertySheet
{
// Attributes
public:
CPage1 m_page1;//
CPage2 m_page2;//
.
}
#include "Page1.h"
#include "Page2.h"
class CProSheet : public CPropertySheet
{
// Attributes
public:
CPage1 m_page1;//
CPage2 m_page2;//
.
}
//CProSheet.cpp
CProSheet::CProSheet()
{
AddPage(&m_page1);
AddPage(&m_page2);
}
CProSheet::CProSheet()
{
AddPage(&m_page1);
AddPage(&m_page2);
}
CProSheet::CProSheet()
{
AddPage(&m_page1);
AddPage(&m_page2);
}
CProSheet::CProSheet()
{
AddPage(&m_page1);
AddPage(&m_page2);
}
void C***::Fun()
{
CProSheet proSheet("属性页测试",this,0);
proSheet.DoModal();
}
{
CProSheet proSheet("属性页测试",this,0);
proSheet.DoModal();
}