Export (0) Print
Expand All
Expand Minimize


Updates the expansion area of the CTaskDialog.

void SetExpansionArea(
   const CString& strExpandedInformation,
   const CString& strCollapsedLabel = _T(""),
   const CString& strExpandedLabel = _T("")

[in] strExpandedInformation

The string that the CTaskDialog displays in the main body of the dialog box when the user clicks the expansion button.

[in] strCollapsedLabel

The string that the CTaskDialog displays next to the expansion button when the expanded area is collapsed.

[in] strExpandedLabel

The string that the CTaskDialog displays next to the expansion button when the expanded area is displayed.

The expansion area of the CTaskDialog Class enables you to provide additional information to the user. The expansion area is in the main part of the CTaskDialog, located immediately underneath the title and content string.

When the CTaskDialog is first displayed, it does not show the expanded information and puts strCollapsedLabel next to the expansion button. When the user clicks the expansion button, the CTaskDialog displays strExpandedInformation and changes the label to strExpandedLabel.

// 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, 

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

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

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


Header: afxtaskdialog.h

© 2014 Microsoft