JavaScript Editor JavaScript Editor     JavaScript Debugger

Previous Section Next Section

Main Page

Displaying Text in Status Bar Panels

To display text in a status bar panel, you can simply use the Text property of a StatusbarPanel object like this, which displays the text "The new text!" when the user clicks a button:

Private Sub Button1_Click(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles Button1.Click
    StatusbarPanel1.Text = "The new text!"
End Sub

You also can access the Text property of a status bar panel using the Panels collection of a StatusBar object, like this (my preferred method):

Private Sub Button1_Click(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles Button1.Click
    StatusBar1.Panels(0).Text = "The new text!"
End Sub

You can see the result of this code in Figure 10.22, in the first panel at left in the status bar of the StatusBars example on the CD-ROM.


Figure 10.22: Displaying text in a status bar panel.
Previous Section Next Section




JavaScript Editor Free JavaScript Editor     JavaScript Editor