A StatusBar is made up of Panel objects, each of which displays different types
of information. All the Panel objects are contained in the Panels Collection of
the StatusBar. The appearance and purpose of each Panel is determined by the Style
property of that Panel. The following styles are available:

FIGURE 4.12 Different styles of the Panel object.
As with the other controls discussed in this chapter, the properties of the
StatusBar and the Button objects can be set either through the Property Pages
dialog box at design time or at runtime. The properties of the StatusBar control
can be set on the General tab, as shown in Figure 4.13.
The Style and SimpleText properties of the toolbar determine the appearance
of the control at runtime. The Style property can have one of two values: Simple
or Normal. When the Style property is Simple, only one panel of the StatusBar
is visible, and the text in the SimpleText property is displayed. When the Style
property is Normal, the StatusBar appears with multiple panels.
FIGURE 4.13 General properties of the StatusBar.
Further properties of the Panel objects give more control over the appearance
of a StatusBar control. These properties can be set on the Panels tab of the Property
Pages dialog box, as shown in Figure 4.14, or at runtime.

FIGURE 4.14 Custom Properties of the Panel object.
The use of ToolTips is available to you with the StatusBar control. Behavior
of ToolTips for the StatusBar is similar to the behavior of ToolTips for the ToolBar
control (discussed earlier in "Using the ToolBar Control").
An individual ToolTipText property is available for each panel of the StatusBar
control. When the ShowTips property of the StatusBar is set to True and the user
rests the mouse pointer over a panel in the StatusBar, the ToolTipText is displayed
at the mouse pointer.
Several other Panel properties affect the appearance of each panel. The Alignment
property determines whether text displayed in a panel is left-justified, right-justified,
or centered. The MinWidth property specifies the minimum width of a panel. The
ScaleMode of the container on which the StatusBar is located determines the units
for the MinWidth. Each panel also has a Width property that determines the starting
width of the object.
The AutoSize property of a panel can also have an impact on its width. This
property can have the following values:
-
sbrNoAutoSize (0) The panel size will not be changed automatically.
-
sbrSpring (1) If the size of the StatusBar increases as the
size of the container grows, the width of the Panel will also increase. As a StatusBar
grows smaller, the size of the Panel will not go below the MinWidth value.
-
sbrCntents (2) The Panel will be resized to fit its contents
but will never fall below the MinWidth.
Another property that affects a panel's appearance is the Picture. Unlike
the other controls discussed in this chapter, the StatusBar does not get images
from an ImageList.
If you wish to include images—either bitmaps or icons—in a panel,
you can add them through the Property Pages dialog box by specifying the file
directly. You can also add them at runtime with the LoadPicture function, which
takes the image file path as its argument, or by setting the Picture property
to one of the ListImages in an
ImageList control or to the appropriate bitmap property of some other
control.
Related topics on StatusBar Control
See Also
<< Previous | Contents
| Next >>