JavaScript Editor JavaScript Editor     JavaScript Debugger

Previous Section Next Section

Main Page

Status Bars

Although toolbars usually appear right under menu bars; status bars usually appear at the bottom of a window and give the user some additional information, such as the page number they're editing, or whether or not the program is connected to the Internet, and so on. In Visual Basic, you support status bars with the StatusBar control. This control can display panels (if it does not display panels, it's called a simple status bar), as you see in Figure 10.5, which is the StatusBars example on the CD-ROM.


Figure 10.5: A status bar at work.

To make the status bar into a simple status bar, which means that you can display a single message on the status bar, set the ShowPanels property to False (this is the default) and set the Text property of the status bar to the text you want to display. Typically, however, status bars are divided into panels by adding StatusBarPanel objects to the status bar and setting the ShowPanels property to True. You can keep track of panels in a status bar using the Panels collection, setting the text in a panel this way, for example: StatusBar1.Panels(0).Text = " Everything's OK ". You can add panels to a status bar at design time by clicking the Panels property in the properties window and using the collection editor that appears, or by the Add method of the Panels collection in code.

Each panel is a StatusbarPanel object. You also can set the text in any such object directly, like this: StatusbarPanel1.Text = "Everything's OK". To handle panel clicks, you use the StatusBar class's PanelClick event; you can determine which panel was clicked with the StatusBarPanel property of the StatusBarPanel ClickEventArgs event object passed to you in this event's handler.

Previous Section Next Section




JavaScript Editor Free JavaScript Editor     JavaScript Editor