This code defines event handlers for a form with two buttons, a label, and two menu items. The "hello" button handler sets the label text to "Yay!", the "cya" button handler closes the form, the "Hello" menu item handler also sets the label text to "Yay!", and the "Bye" menu item handler closes the form. No handler is defined for a click on the label.
This code defines event handlers for a form with two buttons, a label, and two menu items. The "hello" button handler sets the label text to "Yay!", the "cya" button handler closes the form, the "Hello" menu item handler also sets the label text to "Yay!", and the "Bye" menu item handler closes the form. No handler is defined for a click on the label.
This code defines event handlers for a form with two buttons, a label, and two menu items. The "hello" button handler sets the label text to "Yay!", the "cya" button handler closes the form, the "Hello" menu item handler also sets the label text to "Yay!", and the "Bye" menu item handler closes the form. No handler is defined for a click on the label.
Private Sub hello_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
hello.Click Label1.Text = "Yay!" End Sub Private Sub cya_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cya.Click Close() End Sub Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click End Sub Private Sub HelloToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles HelloToolStripMenuItem.Click Label1.Text = "Yay!" End Sub Private Sub ByeToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ByeToolStripMenuItem.Click Close() End Sub End Class