JavaScript Editor JavaScript Editor     JavaScript Debugger

Previous Section Next Section

Main Page

Creating Simple Status Bars

You've added a status bar to your form-now what? By default, status bars only allow you to display a single text string. Such status bars are called simple status bars, and you can display text in them using their Text property. For example, if I wanted to display mouse actions in the status bar, I could do something like this:

Private Sub Form1_MouseEnter(ByVal sender As Object, _
    ByVal e As System.EventArgs) Handles MyBase.MouseEnter
    StatusBar1.Text = "Mouse entered"
End Sub

Private Sub Form1_MouseLeave(ByVal sender As Object, _
    ByVal e As System.EventArgs) Handles MyBase.MouseLeave
    StatusBar1.Text = "Mouse left"
End Sub

You can see the results in Figure 10.20, where the simple status bar at the bottom is reporting that the mouse has entered the form. Want to see how to add panels to a status bar? Take a look at the next topic.


Figure 10.20: Displaying text in a simple status bar.
Previous Section Next Section




JavaScript Editor Free JavaScript Editor     JavaScript Editor