共用方式為


CMFCRibbonProgressBar Class

Implements a control that visually indicates the progress of a lengthy operation.

class CMFCRibbonProgressBar : public CMFCRibbonBaseElement

Members

Public Constructors

Name

Description

CMFCRibbonProgressBar::CMFCRibbonProgressBar

Constructs and initializes a CMFCRibbonProgressBar object.

Public Methods

Name

Description

CMFCRibbonProgressBar::GetPos

Returns the current progress.

CMFCRibbonProgressBar::GetRangeMax

Returns the maximum value of the current range.

CMFCRibbonProgressBar::GetRangeMin

Returns the minimum value of the current range.

CMFCRibbonProgressBar::GetRegularSize

Returns the regular size of the ribbon element. (Overrides CMFCRibbonBaseElement::GetRegularSize.)

CMFCRibbonProgressBar::IsInfiniteMode

Specifies whether the progress bar is working in infinite mode.

CMFCRibbonProgressBar::OnDraw

Called by the framework to draw the ribbon element. (Overrides CMFCRibbonBaseElement::OnDraw.)

CMFCRibbonProgressBar::SetInfiniteMode

Sets the progress bar to work in infinite mode.

CMFCRibbonProgressBar::SetPos

Sets the current progress.

CMFCRibbonProgressBar::SetRange

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 MS Office 2007 Demo sample.

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

CObject

   CMFCRibbonBaseElement

      CMFCRibbonProgressBar

Requirements

Header: afxRibbonProgressBar.h

See Also

Reference

Hierarchy Chart

CMFCRibbonBaseElement Class

CMFCRibbonBar Class

Other Resources

MFC Classes