MFC编写属性页对话框方法

我啊,笨...,还是记下来好...

 

建立一个SDI应用程序,Project->Add to Project->Components and Contrals...->Visual C++ Components文件夹->Property Sheet
点Insert,如果属性页是下一步形式的,选Wizard,...,点Close

实际上是不是下一步形式的属性页,代码表现在在基类的构造函数中,有一个SetWizardMode();,把它屏蔽了就是正常属性页。

要修改“上一步”“下一步”“完成”需要在各个属性页对应的类中继承OnSetActive()和OnKillActive()函数,代码例如:

BOOL CPro1::OnSetActive()
{
 // TODO: Add your specialized code here and/or call the base class
 CProSheet* psheet = (CProSheet*) GetParent();  
 psheet->SetWizardButtons(PSWIZB_NEXT);
 
 return CPropertyPage::OnSetActive();
}

BOOL CPro1::OnKillActive()
{
 // TODO: Add your specialized code here and/or call the base class
 CProSheet* psheet = (CProSheet*) GetParent();  
 psheet->SetWizardButtons(PSWIZB_BACK|PSWIZB_NEXT); 
 
 return CPropertyPage::OnKillActive();
}

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章