CPropertySheet::OnCancel(): Any way to abort the cancellation?
-
I'm allowing a user to enter data in a wizard, and I want to confirm their intention if they are to click on Cancel. One would think overriding OnCancel, popping up a message box, and then NOT calling the base class method if the user did not intend to quit would be sufficient to keep the property sheet from closing... but this is not the case. Simply return'ing instead of calling the base class method closes the dialog anyway. Is there a way to return to the property sheet? I know something similar can be done with CDialog, which is why the property sheet is confusing. Here is the code:
// Handle the Cancel button
void CPageFieldSelection::OnCancel()
{
// Confirm
int result = MessageBox("Are you sure you want to exit?"...);// Only cancel if they clicked YES if (result != IDYES) return; CPropertyPage::OnCancel();
}
The return closes the dialog, as does the CPropertyPage::OnCancel(). :omg: Any help would be appreciated. - Rob
-
I'm allowing a user to enter data in a wizard, and I want to confirm their intention if they are to click on Cancel. One would think overriding OnCancel, popping up a message box, and then NOT calling the base class method if the user did not intend to quit would be sufficient to keep the property sheet from closing... but this is not the case. Simply return'ing instead of calling the base class method closes the dialog anyway. Is there a way to return to the property sheet? I know something similar can be done with CDialog, which is why the property sheet is confusing. Here is the code:
// Handle the Cancel button
void CPageFieldSelection::OnCancel()
{
// Confirm
int result = MessageBox("Are you sure you want to exit?"...);// Only cancel if they clicked YES if (result != IDYES) return; CPropertyPage::OnCancel();
}
The return closes the dialog, as does the CPropertyPage::OnCancel(). :omg: Any help would be appreciated. - Rob
Override CPropertyPage::OnQueryCancel() - that's where you can cancel the cancel operation. :) --Mike-- "Jobs that don't allow you to visit the Lounge 25 times a day at the minimum are not worth having anyway." -- Nish, 3/28/2002 My really out-of-date homepage Sonork - 100.10414 AcidHelm Big fan of Alyson Hannigan and Jamie Salé.