Difference between revisions of "Building a Visual Basic Status Bar"

From Techotopia
Jump to: navigation, search
(New page: The status bar provides a location for the application developer to convey information to the user about what is happening in an application. For example, when an application is reading a ...)
(No difference)

Revision as of 17:19, 27 July 2007

The status bar provides a location for the application developer to convey information to the user about what is happening in an application. For example, when an application is reading a file the status bar might display text which reads "Opening file....". Many applications provide a status bar across the bottom of forms and this is often where a user will lok for feedback on what an application is doing. For this reason alone, it is well worth learning how to add a status bar to your applications.

Adding a Status Bar to a Visual Basic Application

Status bar functionality is provided by the Visual Basic StatusStrip control. To add a status bar to a form, therefore, locate the StatusStrip control in the Menus and Toolbars section of the Visual Studio Toolbox and double click on it to add it to the current selected form. The StatusStrip will appear running along the botton of the form:

File:Exampl.jpg

Adding Items to a Status Bar

When a StatusStrip has been added to a form it will display a single button which, when clicked, drops down a list of new control types which can be added to the status bar (SplitButton, ProgressBar, StatusLabel, DropDownButton). Select a StatusLabel from the menu. Next, select the StatusLabel you added and change the Text property in the Properties panel to Ready.

Press F5 to build and run the application. When the application runs the new StatusStrip should appear containing the StatusLabel with the specified text:

File:Exampl.jpg