Visual Studio 2010 - Visual C++
CTaskDialog::SetProgressBarState
Sets the state of the progress bar and displays it on the CTaskDialog.
void SetProgressBarState( int nState = PBST_NORMAL );
Parameters
Remarks
This method throws an exception with the ENSURE (MFC) macro if the CTaskDialog is already displayed and has a marquee progress bar.
The following table lists the possible values for nState. In all these cases, the progress bar will fill with the regular color until it reaches the designated stop position. At that point it will change color based on the state.
You can set where the progress bar stops with CTaskDialog::SetProgressBarPosition.
Example
Visual C++
// 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 a marquee progress bar. taskDialog.SetProgressBarMarquee(); taskDialog.DoModal(); // Remove the marquee bar and replace it with a standard progress bar taskDialog.SetProgressBarMarquee(0); taskDialog.SetProgressBarRange(0, 100); taskDialog.SetProgressBarPosition(75); taskDialog.SetProgressBarState(); taskDialog.DoModal();
Requirements
Header: afxtaskdialog.h
See Also