次の方法で共有


CPropertySheet::SetWizardButtons

ウィザードのプロパティ シートの切り替えを、次のコード、または完了のボタンを有効または無効にします。

void SetWizardButtons(
   DWORD dwFlags 
);

パラメーター

  • dwFlags
    ウィザードのボタンの機能と外観をカスタマイズする一連のフラグ。このパラメーターには、次の値の組み合わせです:

    • PSWIZB_BACK の[戻る]ボタン

    • 次 のPSWIZB_NEXT のボタン

    • PSWIZB_FINISH の[完了]

    • PSWIZB_DISABLEDFINISH の無効の[完了]

解説

ダイアログの後にのみ使用 SetWizardButtons は開いています; DoModalを呼び出す前に SetWizardButtons を呼び出すことはできません。通常、CPropertyPage::OnSetActiveから SetWizardButtons を呼び出す必要があります。

[完了]のテキストを変更するか、または次と[戻る]ボタンを非表示にするに一度ユーザーがウィザードを完了したら、SetFinishTextを呼び出します。同じボタンが完了すると、次に共有されることに注意してください。完了または次のボタン、両方を同時に表示することはできません。

使用例

CPropertySheet に、3 種類のウィザードのプロパティ ページがあります: CStylePage、CColorPageと CShapePage。次のコード ウィザードのプロパティ ページの *** [戻る] ***次へ のボタンを有効および無効にする方法を示します。

// CStylePage is the first wizard property page.  Disable the Back 
// button but enable the Next button.
BOOL CStylePage::OnSetActive() 
{
   CPropertySheet* psheet = (CPropertySheet*) GetParent();   
   psheet->SetWizardButtons(PSWIZB_NEXT);

   return CPropertyPage::OnSetActive();
}
// CColorPage is the second wizard property page. Enable both the 
// Back button and the Next button.
BOOL CColorPage::OnSetActive() 
{
   CPropertySheet* psheet = (CPropertySheet*) GetParent();   
   psheet->SetWizardButtons(PSWIZB_BACK | PSWIZB_NEXT);

   return CPropertyPage::OnSetActive();
}
// CShapePage is the last wizard property page. Enable the Back 
// button and change the Next button to Finish. The "Finish" button 
// will have "Done" as its caption.
BOOL CShapePage::OnSetActive() 
{
   CPropertySheet* psheet = (CPropertySheet*) GetParent();   
   psheet->SetWizardButtons(PSWIZB_BACK | PSWIZB_FINISH);
   psheet->SetFinishText(_T("Done"));

   return CPropertyPage::OnSetActive();
}

必要条件

ヘッダー : afxdlgs.h

参照

関連項目

CPropertySheet クラス

階層図