CTaskDialog::SetProgressBarPosition
調整進度列的位置。
void SetProgressBarPosition(
int nProgressPos
);
參數
- [in] nProgressPos
進度列的位置。
備註
如果 nProgressPos 不在進度列範圍,這個方法會擲回。 ENSURE (MFC) 巨集的例外狀況。 您可以變更與 CTaskDialog::SetProgressBarRange的進度列範圍。
範例
// 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();
需求
標題: afxtaskdialog.h
請參閱
參考
CTaskDialog::SetProgressBarMarquee