<!-- Link to source file download -->
Download source files - 2 Kb
<!-- Add the rest of your HTML here -->
Windows allows a simple transition of your property sheet into wizard mode. However, this transition requires the
property pages within the sheet to know about this. They should call
SetWizardButtons() with the correct parameters on becoming active - which of course breaks encapsulation. The page needs to know it's part of wizard-style property sheet, and it needs to know its position within the sheet.
CWizardPropertySheet class solves the problem for simple wizards by having the
CPropertySheet-derived class handle the appropriate
SetWizardButtons() calls by
The CWizardPropertySheet class
CWizardPropertySheet is a drop-in replacement for
CPropertySheet. It works both in
wizard and "normal" modes. (The application must call
SetWizardMode() to activate wizard mode, just
as it would with a normal
To use it, simply
#include "WizardPropertySheet.h" and use
wherever you would use
CPropertySheet. (Alternatively, you may import the class by ClassWizard.)
What does it do?
CWizardPropertySheet shows the property pages added by
AddPage() call in order
they have been added. It disables the Back button on the first page, and it changes Next to
Finish on the last page.
How does it accomplish that?
The message map of the class contains handlers:
ID_WIZNEXT constants are defined in
handlers do the proper
SetWizardButtons() call and then call
Default(); to allow page
change to proceed.
Don't forget to call
DoModal() to put the property sheet into