CTaskDialog::SetVerificationCheckbox

设置验证复选框中选中状态。

void SetVerificationCheckbox(
   BOOL bChecked
);

参数

  • [in] bChecked
    TRUE 具有验证复选框,当 CTaskDialog 显示;具有的 FALSE 未选择验证的复选框,当 CTaskDialog 显示。

示例

// 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 );

// Add the verification checkbox and set the default state.
taskDialog.SetVerificationCheckboxText(L"Remember your selection.");
taskDialog.SetVerificationCheckbox(false);

taskDialog.DoModal();

if (taskDialog.GetVerificationCheckboxState())
{
    // TODO: Write settings of the task dialog to the registry
}

要求

标头: afxtaskdialog.h

请参见

参考

CTaskDialog类选件

层次结构图

CTaskDialog::SetVerificationCheckboxText