要点:1:先创建3个基于CPropertyPage类的属性页,并为其添加响应函数,onSetActive(),OnWizardNext()函数,添加如下代码:第二页中添加个复选框控件,并将其与m_check1关联将其初始化为false

BOOL CStep2::OnSetActive()
{
 CPropertySheet *pSheet=(CPropertySheet *)GetParent();
 ASSERT_KINDOF(CPropertySheet,pSheet);
 pSheet->SetWizardButtons(PSWIZB_NEXT|PSWIZB_BACK); 
 return CPropertyPage::OnSetActive();

}

LRESULT CStep2::OnWizardNext()
{
 UpdateData();
 if(!m_check)
 {
  MessageBox("You must check the box.");
  return -1;
 }

 return CPropertyPage::OnWizardNext();
}

2:创建个 基于CPropertySheet 类的属性表,添加3个属性页的变量,

在该类下的2个函数中增加代码:

CWizardSheet::CWizardSheet(UINT nIDCaption, CWnd* pParentWnd, UINT iSelectPage)
 :CPropertySheet(nIDCaption, pParentWnd, iSelectPage)
{//增加的代码
 AddPage(&m_step1);
 AddPage(&m_step2);
 AddPage(&m_step3);
}

CWizardSheet::CWizardSheet(LPCTSTR pszCaption, CWnd* pParentWnd, UINT iSelectPage)
 :CPropertySheet(pszCaption, pParentWnd, iSelectPage)
{//增加的代码
 AddPage(&m_step1);
 AddPage(&m_step2);
 AddPage(&m_step3);
}

在APP类里修改代码:

CWizardSheet dlg("Wizard Sheet");
 m_pMainWnd = &dlg;
 dlg.SetWizardMode( );
 int nResponse = dlg.DoModal();
 return FALSE;

 

这样就建好了……

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-09-13
  • 2022-01-13
  • 2021-04-03
  • 2021-09-30
  • 2021-06-13
  • 2021-07-18
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-04-13
  • 2021-11-10
  • 2021-10-29
  • 2022-01-16
  • 2021-12-04
相关资源
相似解决方案