BOOL CYourPropertyPageN::OnWizardFinish() 
{
// return CPropertyPage::OnWizardFinish();
}
同样:
在void yourclass::OnOK
{
//CDialog::OnOK;
}
void yourclass::OnCancel
{
//CDialog::OnCancel;
}

解决方案 »

  1.   

    重载CMyPropertyPage的OnOk、OnCancel并其调用CPropertyPage::OnOk()、CPropertyPage::OnCancel()前return;但CPropertySheet属性框仍被关闭。我现在要让属性框关不掉,该怎么办?还有,如何让属性框右上角的'X'变灰?
      

  2.   

    ...
    HMENU hSysMenu;hSysMenu = ::GetSystemMenu( GetSafeHwnd(), 0 );
    RemoveMenu(hSysMenu, 1, MF_BYPOSITION);::SendMessage( GetSafeHwnd(), WM_NCPAINT, 1, 0 ); 
    ...
      

  3.   

    没人能回答这个问题吗?如何能使CPropertySheet不能被关闭?望各位大侠赐教!谢谢xzou和casl,不过你们的方法好象达不到目的
      

  4.   

    BOOL CMYSheet::OnInitDialog() 
    {
    SetIcon(m_hIcon, TRUE); // Set big icon
    SetIcon(m_hIcon, FALSE); // Set small icon BOOL bResult = CPropertySheet::OnInitDialog();
    CMenu *mnu=this->GetSystemMenu(FALSE);
    mnu->EnableMenuItem(SC_CLOSE,MF_BYCOMMAND|MF_GRAYED);
    return bResult;
    }
      

  5.   

    casl:那该如何在用户点击ok和cancel按钮时防止对话框的关闭呢?
      

  6.   

    BOOL CMYSheet::OnCommand(WPARAM wParam, LPARAM lParam) 
    {
    // TODO: Add your specialized code here and/or call the base class
    if(LOWORD(wParam)==IDOK ||LOWORD(wParam)==IDCANCEL)return true;
    return CPropertySheet::OnCommand(wParam, lParam);
    }