Share via


Using CStatusBarCtrl to Create a CStatusBarCtrl Object

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at Using CStatusBarCtrl to Create a CStatusBarCtrl Object.

Here is an example of a typical use of CStatusBarCtrl:

To use a status bar control with parts

  1. Construct the CStatusBarCtrl object.

  2. Call SetMinHeight if you want to set the minimum height of the status bar control's drawing area.

  3. Call SetBkColor to set the background color of the status bar control.

  4. Call SetParts to set the number of parts in a status bar control and the coordinate of the right edge of each part.

  5. Call SetText to set the text in a given part of the status bar control. The message invalidates the portion of the control that has changed, causing it to display the new text when the control next receives the WM_PAINT message.

In some cases, the status bar only needs to display a line of text. In this case, make a call to SetSimple. This puts the status bar control into "simple" mode, which displays a single line of text.

See Also

Using CStatusBarCtrl
Controls