Skip to content

Latest commit

 

History

History
23 lines (16 loc) · 1.69 KB

initializing-the-parts-of-a-cstatusbarctrl-object.md

File metadata and controls

23 lines (16 loc) · 1.69 KB
description title ms.date helpviewer_keywords ms.assetid
Learn more about: Initializing the Parts of a CStatusBarCtrl Object
Initializing the Parts of a CStatusBarCtrl Object
11/04/2016
CStatusBarCtrl class [MFC], simple mode
status bars [MFC], declaring parts of
simple status bars [MFC]
status bars [MFC], icons
status bars [MFC], simple mode
icons, using in status bars
CStatusBarCtrl class [MFC], declaring parts of
60e8f285-d2d8-424a-a6ea-2fc548370303

Initializing the Parts of a CStatusBarCtrl Object

By default, a status bar displays status information using separate panes. These panes (also referred to as parts) can contain either a text string, an icon, or both.

Use SetParts to define how many parts, and the length, the status bar will have. After you have created the parts of the status bar, make calls to SetText and SetIcon to set the text or icon for a specific part of the status bar. Once the part has been successfully set, the control is automatically redrawn.

The following example initializes an existing CStatusBarCtrl object (m_StatusBarCtrl) with four panes and then sets an icon (IDI_ICON1) and some text in the second part.

[!code-cppNVC_MFCControlLadenDialog#31]

For more information on setting the mode of a CStatusBarCtrl object to simple, see Setting the Mode of a CStatusBarCtrl Object.

See also

Using CStatusBarCtrl
Controls