Поделиться через


CTaskDialog::SetProgressBarMarquee

Configures a marquee bar for the CTaskDialog and adds it to the dialog box.

void SetProgressBarMarquee(
   BOOL bEnabled = TRUE,
   int nMarqueeSpeed = 0
);

Parameters

  • [in] bEnabled
    TRUE to enable the marquee bar; FALSE to disable the marquee bar and remove it from the CTaskDialog.

  • [in] nMarqueeSpeed
    An integer that indicates the speed of the marquee bar.

Remarks

The marquee bar appears underneath the main text of the CTaskDialog Class.

Use nMarqueeSpeed to set the speed of the marquee bar; larger values indicate a slower speed. A value of 0 for nMarqueeSpeed makes the marquee bar move at the default speed for Windows Vista.

This method throws an exception with the ENSURE (MFC) macro if nMarqueeSpeed is less than 0.

Example

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

Reference

CTaskDialog Class

Hierarchy Chart

CTaskDialog::SetProgressBarPosition

CTaskDialog::SetProgressBarRange

CTaskDialog::SetProgressBarState