Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2008
Visual Studio
Visual C++
MFC
MFC Concepts
User Interface
Controls (MFC)
Using CProgressCtrl
 Manipulating the Progress Control

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
MFC Library Reference
Manipulating the Progress Control

There are three ways to change the current position of a progress control (CProgressCtrl).

  • The position can be changed by a preset increment amount.

  • The position can be changed by an arbitrary amount.

  • The position can be changed to a specific value.

To change the position by a preset amount

  1. Use the SetStep member function to set the increment amount. By default, this value is 10. This value is typically set as one of the initial settings for the control. The step value can be negative.

  2. Use the StepIt member function to increment the position. This causes the control to redraw itself.

    NoteNote:

    StepIt will cause the position to wrap. For example, given a range of 1 –100, a step of 20, and a position of 90, StepIt will set the position to 10.

To change the position by an arbitrary amount

  • Use the OffsetPos member function to change the position. OffsetPos will accept negative values.

    NoteNote:

    OffsetPos, unlike StepIt, will not wrap the position. The new position is adjusted to remain within the range.

To change the position to a specific value

  • Use the SetPos member function to set the position to a specific value. If necessary, the new position is adjusted to be within the range.

Typically, the progress control is used solely for output. To get the current position without specifying a new value, use GetPos.

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker