System.Windows.Forms.StatusBar Class

Represents a Windows status bar control. Although System.Windows.Forms.ToolStripStatusLabel 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: StatusBar Members

Syntax

[System.ComponentModel.DefaultProperty("Text")]
[System.ComponentModel.Designer("System.Windows.Forms.Design.StatusBarDesigner, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.ComponentModel.Design.IDesigner")]
[System.ComponentModel.DefaultEvent("PanelClick")]
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.Runtime.InteropServices.ComVisible(true)]
public class StatusBar : Control

Remarks

Typically, a System.Windows.Forms.StatusBar control consists of System.Windows.Forms.StatusBarPanel objects, each of which displays text and/or an icon. You can also provide owner-drawn panels to provide custom panels such as a progress bar or a series of images that displays the state of your application. A System.Windows.Forms.StatusBar control typically displays information about an object being viewed on a System.Windows.Forms.Form, the object's components, or contextual information that relates to that object's operation within your application.

The System.Windows.Forms.StatusBar control provides properties that enable you to customize the appearance of the control. If the System.Windows.Forms.StatusBar is displayed on a form that can be resized, you can use the StatusBar.SizingGrip property to display a sizing grip in the lower-right corner of the form to indicate to users that the form can be resized. The StatusBar.ShowPanels property enables you to display panels within your System.Windows.Forms.StatusBar or to display only the value of the Control.Text property of the control.

The default System.Windows.Forms.StatusBar has no panels. To add panels to a System.Windows.Forms.StatusBar you can use the System.Windows.Forms.StatusBar.StatusBarPanelCollection.Add(string) method of the System.Windows.Forms.StatusBar.StatusBarPanelCollection class that is accessible through the StatusBar.Panels property of the control. You can also use the System.Windows.Forms.StatusBar.StatusBarPanelCollection object provided through the StatusBar.Panels property to remove panels from the control and access a specific System.Windows.Forms.StatusBarPanel to manipulate the panel.

If you want to determine when a System.Windows.Forms.StatusBarPanel object within a System.Windows.Forms.StatusBar control is clicked, you can create an event handler for the StatusBar.PanelClick event. To perform owner-draw operations on a panel, you can create an event handler for the StatusBar.DrawItem event. The event data passed to the event handler provides information on the panel to draw and a System.Drawing.Graphics object to use to perform drawing tasks.

When you create an instance of System.Windows.Forms.StatusBar, the read/write properties are set to initial values. For a list of these values, see the StatusBar.#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