System.Windows.Forms.StatusBarPanel Class

Represents a panel in a System.Windows.Forms.StatusBar control. Although the System.Windows.Forms.StatusStrip control replaces and adds functionality to the System.Windows.Forms.StatusBar control of previous versions, System.Windows.Forms.StatusBar is retained for both backward compatibility and future use if you choose.

See Also: StatusBarPanel Members

Syntax

[System.ComponentModel.DesignTimeVisible(false)]
[System.ComponentModel.DefaultProperty("Text")]
[System.ComponentModel.ToolboxItem(false)]
public class StatusBarPanel : System.ComponentModel.Component, System.ComponentModel.ISupportInitialize

Remarks

A System.Windows.Forms.StatusBarPanel represents an individual panel in the System.Windows.Forms.StatusBar.StatusBarPanelCollection of a System.Windows.Forms.StatusBar control. A System.Windows.Forms.StatusBarPanel can contain text and/or an icon that can be used to reflect the status of an application. Use the System.Windows.Forms.StatusBar.StatusBarPanelCollection, accessible through the StatusBar.Panels property of a System.Windows.Forms.StatusBar control, to retrieve, add, or remove an individual System.Windows.Forms.StatusBarPanel.

The System.Windows.Forms.StatusBarPanel provides properties that enable you to modify the display behavior of a panel within a System.Windows.Forms.StatusBar control. You can use the StatusBarPanel.Icon property to display an icon within a panel. This property can be used to provide a graphical representation of state in an application. The StatusBarPanel.Alignment property enables you to specify how text and/or an icon is aligned within the panel. To ensure that your panel is sized properly to fit the text of the panel, you can use the StatusBarPanel.AutoSize property to automatically resize the panel to fit the text of the panel or to fill the remaining space within the System.Windows.Forms.StatusBar control. The StatusBarPanel.MinWidth property enables you to specify a minimum width for the panel to ensure that it does not get smaller than the data it is intended to display.

The System.Windows.Forms.StatusBar control is typically used to display Help information or state information about your application. Often, it is important to display additional information about data that is presented in a panel. You can use the StatusBarPanel.ToolTipText property to display information whenever the mouse pointer rests on a panel.

Although the System.Windows.Forms.StatusBar control is typically used to display textual information, you can also provide your own type of display to a System.Windows.Forms.StatusBarPanel. The StatusBarPanel.Style property enables you to specify how the System.Windows.Forms.StatusBarPanel will be drawn. By default, the StatusBarPanel.Style property is used to display the value of the StatusBarPanel.Text property (and an icon, if specified in the StatusBarPanel.Icon property). If the property is set to StatusBarPanelStyle.OwnerDraw, you can draw your own information into the panel. You can use this feature to draw a progress bar or an animated icon in the panel.

When you create an instance of the System.Windows.Forms.StatusBarPanel class, the read/write properties are set to initial values. For a list of these values, see the StatusBarPanel.#ctor constructor.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0