المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : disabling finish button on property sheet wizard



C++ Programming
08-05-2009, 02:21 PM
Hi

Can anyone tell me how i can disable the finish button on a property sheet wizard ?

on my property page i initally define the buttons like


BOOL CPage::OnSetActive()
{
CWizard* pParent = (CWizard*)GetParent();
ASSERT_KINDOF(CWizard, pParent);
pParent->SetWizardButtons(PSWIZB_BACK | PSWIZB_FINISH);

return CPropertyPage::OnSetActive();
}


I then want to disable the finish button until a certain task has completed

i.e


void CPage::OnBnClickedBstart()
{
GetDlgItem(ID_WIZFINISH)->EnableWindow(FALSE);
DoSomething();
GetDlgItem(ID_WIZFINISH)->EnableWindow(TRUE);

}



i have also tried adding

CWnd *pWnd = GetDlgItem (ID_WIZFINISH);
pWnd->EnableWindow(FALSE);


but get the same problem

Can anyone help at all

thanks

Simon