共用方式為


CTaskDialog::SetFooterIcon

void SetFooterIcon(
   HICON hFooterIcon
);

void SetFooterIcon(
   LPCWSTR lpszFooterIcon
);

參數

  • [in] hFooterIcon
    CTaskDialog的新圖示。

  • [in] lpszFooterIcon
    CTaskDialog的新圖示。

備註

頁尾圖示會顯示在 CTaskDialog 類別底端顯示。 它可以與頁尾文字。 您可以變更與 CTaskDialog::SetFooterText的頁尾文字。

這個方法會擲回。 ENSURE (MFC) 巨集的例外狀況,如果 CTaskDialog 顯示或輸入參數是 NULL。

CTaskDialog 只能接受 HICON 或 LPCWSTR 做為頁尾圖示。 設定在建構函式或 CTaskDialog::SetOptions的選項設定這 TDF_USE_HICON_FOOTER 。 根據預設,設定為 CTaskDialog 使用 LPCWSTR 做為輸入型別指定頁尾圖示。 使用不正確的型別,,,如果您嘗試設定圖示這個方法會產生例外狀況。

範例

// TODO: Replace the strings below with the appropriate message,  
// main instruction, and dialog title
CString message("This is an important message to the user.");
CString mainInstruction("Important!\nPlease read!");
CString title("Alert Dialog");

CTaskDialog taskDialog(message, mainInstruction, title, 
    TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON );

// Setting new information to be able to reuse the dialog resource
taskDialog.SetWindowTitle(L"New title for the task dialog");
taskDialog.SetContent(L"New message to show the user.");
taskDialog.SetMainInstruction(L"Even more important!");
taskDialog.SetMainIcon(TD_ERROR_ICON);
taskDialog.SetDialogWidth(300);

// Add a footer
taskDialog.SetFooterText(L"Footer information for the dialog.");
taskDialog.SetFooterIcon(TD_INFORMATION_ICON);

// Add expansion information
taskDialog.SetExpansionArea(L"Additional information\non two lines.",
    L"Click here for more information.",
    L"Click here to hide the extra information.");

// Change the options to show the expanded information by default. 
// It is necessary to retrieve the current options first. 
int options = taskDialog.GetOptions();
options |= TDF_EXPANDED_BY_DEFAULT;
taskDialog.SetOptions(options);

taskDialog.DoModal();

需求

標題: afxtaskdialog.h

請參閱

參考

CTaskDialog 類別

階層架構圖表

CTaskDialog::CTaskDialog

CTaskDialog::SetFooterText