Freigeben über


StatusBar Control Overview (Windows Forms)

NoteImportant

The StatusStrip and ToolStripStatusLabel controls replace and add functionality to the StatusBar and StatusBarPanel controls; however, the StatusBar and StatusBarPanel controls are retained for both backward compatibility and future use, if you choose.

The Windows Forms StatusBar Control (Windows Forms) is used on forms as an area, usually displayed at the bottom of a window, in which an application can display various kinds of status information. StatusBar controls can have status bar panels on them that display text or icons to indicate state, or a series of icons in an animation that indicate a process is working; for example, Microsoft Word indicating that the document is being saved.

Using the StatusBar Control

Internet Explorer uses a status bar to indicate the URL of a page when the mouse rolls over the hyperlink; Microsoft Word gives you information on page location, section location, and editing modes such as overtype and revision tracking; and Visual Studio uses the status bar to give context-sensitive information, such as telling you how to manipulate dockable windows as either docked or floating.

You can display a single message on the status bar by setting the ShowPanels property to false (the default) and setting the Text property of the status bar to the text you want to appear in the status bar. You can divide the status bar into panels to display more than one type of information by setting the ShowPanels property to true and using the Add method of StatusBarPanelCollection.

See Also

Tasks

How to: Determine Which Panel in the Windows Forms StatusBar Control Was Clicked

Reference

StatusBar
ToolStripStatusLabel