Chapter 12: Dialog-Based Windows Visual C++ and MFC Fundamentals
- Return to MSVC and close the project (MSVC 6: File -> Close Workspace; MSVC
7: File -> Close Solution)
12.3.4..Wizard Pages........................................................................................
A wizard, like a property sheet, is a series of dialog boxes that are considered as one
entity, tremendously saving the available space. When put together, the dialog boxes are
referred to as wizard pages. Like the property pages, the wizard pages can help the
programmer add more Windows controls than a single dialog box with the same
dimension would allocate. While the property pages are positioned one in front of the
others in a z-axis, the wizard pages are positioned so that, when one displays, the others
are completely hidden. While a property page can be accessed by the user clicking its tab
to bring it to the front and send the others to the back, a wizard is equipped with buttons
such as Back or Next.
A wizard is created using the exact same approach as the property sheet. Each involved
dialog box is created with the same properties:
?? Style: Child
?? Border: Thin
?? Title Bar: True
?? System Menu: False
?? Visible: False
?? Disabled: True
Each page is based on the CPropertyPage class. To display the wizard, use the
CPropertySheet class in the exact same way as seen for the property pages above. The
only difference is that, to make this a wizard, you must call the
CPropertySheet::SetWizardMode() method before calling DoModal(). The syntax of
the SetWizardMode() member function is:
void SetWizardMode();