Skip to content

Latest commit

 

History

History
29 lines (19 loc) · 1.65 KB

using-cstatusbarctrl-to-create-a-cstatusbarctrl-object.md

File metadata and controls

29 lines (19 loc) · 1.65 KB
description title ms.date helpviewer_keywords ms.assetid
Learn more about: Using CStatusBarCtrl to Create a CStatusBarCtrl Object
Using CStatusBarCtrl to Create a CStatusBarCtrl Object
11/04/2016
status bar controls [MFC], creating
CStatusBarCtrl class [MFC], creating
365c2b65-12de-49e6-9a2e-416c6ee10d60

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