Disabling the Cancel button in a Wizard

2004-01-09 13:03:00 +0000

CPropertySheet provides the SetWizardButtons function, allowing you to enable or disable the “Back” or “Next” buttons. It doesn’t, however, allow you to disable the “Cancel” button.

Here’s how:

CWnd *pCancel = GetParent()->GetDlgItem(IDCANCEL);
if (pCancel)
	pCancel->EnableWindow(FALSE);