次の方法で共有


CTaskDialog::SetFooterIcon

CTaskDialog のフッター アイコンを更新します。

void SetFooterIcon(
   HICON hFooterIcon
);

void SetFooterIcon(
   LPCWSTR lpszFooterIcon
);

パラメーター

  • [入力] hFooterIcon
    CTaskDialog の新しいアイコン。

  • [入力] lpszFooterIcon
    CTaskDialog の新しいアイコン。

解説

フッター アイコンは、CTaskDialog クラスの下部に表示されます。 フッター テキストを関連付けることもできます。 CTaskDialog::SetFooterText を使用してフッター テキストを変更できます。

CTaskDialog が表示されている場合、または入力パラメーターが NULL である場合、このメソッドは、ENSURE (MFC) マクロによって例外をスローします。

CTaskDialog では、HICON または LPCWSTR だけをフッター アイコンとして使用できます。 これは、コンストラクターまたは CTaskDialog::SetOptionsTDF_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