JavaScript Editor JavaScript Editor     JavaScript Debugger

Previous Section Next Section

Main Page

Handling Label Events

Here's something that even experienced Visual Basic programmers often don't know—labels have events like Click and DoubleClick (although they don't have any keystroke-handling events). Using these events can be a good thing if you're using a label control as more than just a label; for example, to reset a setting of some kind. Here's an example using the DoubleClick event to change the text in the label when the user double-clicks it:

Private Sub Label1_DoubleClick(ByVal sender As Object, _
    ByVal e As System.EventArgs) Handles Label1.DoubleClick
    Label1.Text = "Quit clicking me!"
End Sub
Previous Section Next Section

JavaScript Editor Free JavaScript Editor     JavaScript Editor