CTaskDialog::SetExpansionArea
확장 영역을 업데이트는 CTaskDialog.
void SetExpansionArea(
const CString& strExpandedInformation,
const CString& strCollapsedLabel = _T(""),
const CString& strExpandedLabel = _T("")
);
매개 변수
[in] strExpandedInformation
문자열에는 CTaskDialog 확장 단추를 클릭할 때 대화 상자 본문에 표시 됩니다.[in] strCollapsedLabel
문자열에는 CTaskDialog 확장 된 영역을 축소 하면 옆에 있는 확장 단추를 표시 합니다.[in] strExpandedLabel
문자열에는 CTaskDialog 확장 된 영역에 표시 될 때 확장 단추 옆에 표시 됩니다.
설명
확장 영역을 CTaskDialog 클래스 사용자에 게 추가 정보를 제공할 수 있습니다.확장 영역에서 주된 부분입니다는 CTaskDialog, 제목 및 내용 문자열 바로 아래 위치 합니다.
경우는 CTaskDialog 처음 확장 된 정보를 표시 하지 않습니다 및 배치 표시, strCollapsedLabel 확장 단추 옆에 있는.사용자가 확장 단추를 클릭할 때의 CTaskDialog 표시 strExpandedInformation 레이블로 변경 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,
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