CMFCRibbonProgressBar Class
Implements a control that visually indicates the progress of a lengthy operation.
class CMFCRibbonProgressBar : public CMFCRibbonBaseElement
Members
Public Constructors
Name |
Description |
---|---|
Constructs and initializes a CMFCRibbonProgressBar object. |
Public Methods
Name |
Description |
---|---|
Returns the current progress. |
|
Returns the maximum value of the current range. |
|
Returns the minimum value of the current range. |
|
Returns the regular size of the ribbon element. (Overrides CMFCRibbonBaseElement::GetRegularSize.) |
|
Specifies whether the progress bar is working in infinite mode. |
|
Called by the framework to draw the ribbon element. (Overrides CMFCRibbonBaseElement::OnDraw.) |
|
Sets the progress bar to work in infinite mode. |
|
Sets the current progress. |
|
Sets the minimum and maximum values. |
Remarks
A CMFCRibbonProgressBar can operate in two modes: regular and infinite. In regular mode, the progress bar is filled from left to right and stops when it reaches the maximum value. In infinite mode, the progress bar is repeatedly filled from the minimum value to the maximum value. You might use infinite mode to indicate that an operation is ongoing, but that the completion time is unknown.
Example
The following example demonstrates how to use various methods in the CMFCRibbonProgressBar class. The example shows how to set the progress bar to work in infinite mode (where the completion time of an operation is unknown), set the minimum and maximum values for the progress bar, and set the current position of the progress bar. This code snippet is part of the MSOffice2007Demo Sample: MFC Office Application.
// int cxProgress
// BOOL m_bInfiniteProgressMode
CMFCRibbonProgressBar* pProgressBar = new CMFCRibbonProgressBar(ID_STATUSBAR_PROGRESS, cxProgress);
pProgressBar->SetInfiniteMode(m_bInfiniteProgressMode);
pProgressBar->SetRange(0,200);
pProgressBar->SetPos(200,true);
Inheritance Hierarchy
Requirements
Header: afxRibbonProgressBar.h