1. Create a wizard dialog box
When using specific software, we often use wizard mode to create new files in this program, the most typical example is to use the wizard in Frontpage2000 or Word2000 to create a new Web page file or Word document. Do you have any impulse to see that other programs can provide a user-friendly wizard dialog box? If so, you might want to use the following code to Create a wizard dialog box:
以 下是引用片段:
void CMy56_s1Dlg::OnWiz()
{
CSheet sheet;
sheet.SetWizardMode();
int iRet=sheet.DoModal();//返回ID_WIZFINISH或 IDCANCEL
}
//重载BOOL CPropertyPage::OnSetActive( )来控制显示的按钮
BOOL CPage1::OnSetActive()
{
((CPropertySheet*)GetParent())- >SetWizardButtons(PSWIZB_BACK|PSWIZB_NEXT);
return CPropertyPage::OnSetActive();
}
BOOL CPage2::OnSetActive()
{
((CPropertySheet*)GetParent())->SetWizardButtons (PSWIZB_BACK|PSWIZB_FINISH);
return CPropertyPage::OnSetActive();
}