共用方式為


CPropertySheet::SetWizardButtons

啟用或停用在精靈屬性工作表的後置,下一個或結束按鈕。

void SetWizardButtons(
   DWORD dwFlags 
);

參數

  • dwFlags
    自訂精靈] 按鈕功能和外觀的旗標集。 這個參數可以是下列值的組合:

    • PSWIZB_BACK 向後按鈕

    • PSWIZB_NEXT 下個按鈕

    • PSWIZB_FINISH 結束按鈕。

    • PSWIZB_DISABLEDFINISH 停用的完成按鈕

備註

在 對話方塊之後立即呼叫 SetWizardButtons 開啟;,在呼叫 DoModal之前,您不能呼叫 SetWizardButtons 。 一般而言,您應該呼叫 CPropertyPage::OnSetActiveSetWizardButtons

如果您想要變更結束按鈕上的文字或隱藏下一頁和上一頁按鈕使用者一次完成精靈,請呼叫 SetFinishText。 請注意相同的按鈕來關閉共用和秒。 您可以一次顯示結束或 [下一步] 按鈕,在中,但不能同時包含兩者。

範例

CPropertySheet 有三個精靈屬性頁: 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();
}

需求

Header: afxdlgs.h

請參閱

參考

CPropertySheet 類別

階層架構圖