Udostępnij za pośrednictwem


Property Sheets as Wizards

A key characteristic of a wizard property sheet is that navigation is provided with Next or Finish, Back, and Cancel buttons instead of tabs. You need to call CPropertySheet::SetWizardMode before calling CPropertySheet::DoModal on the property sheet object to take advantage of this feature.

The user receives the same CPropertyPage::OnSetActive and CPropertyPage::OnKillActive notifications while moving from one page to another page. Next and Finish buttons are mutually exclusive controls; that is, only one of them will be shown at a time. On the first page, the Next button should be enabled. If the user is on the last page, the Finish button should be enabled. This is not done automatically by the framework. You have to call CPropertySheet::SetWizardButton on the last page to achieve this.

To display all of the default buttons, you mush show the Finish button and move the Next button. Then move the Back button so that its relative position to the Next button is maintained. For more explanation, search for KB article Q143210. Knowledge Base articles are available in the MSDN Library.

Example

void CMyView::OnWizard()
{
   CPropertySheet sheet;
   // CMyFirstPage and CMySecondPage are derived from CPropertyPage
   CMyFirstPage page1;
   CMySecondPage page2;

   sheet.AddPage(&page1);
   sheet.AddPage(&page2);
   sheet.SetWizardMode();
   sheet.DoModal();
}

See Also

Concepts

Property Sheets (MFC)