0% found this document useful (0 votes)
69 views

Exercise 6

This document contains code for a form with two buttons and menu items that change the text of a label. Button1 and the Hello menu item set the label text to "Hello!", while Button2 and the Goodbye menu item set the label text to "Goodbye!". The Exit menu item closes the application when clicked.

Uploaded by

api-307933689
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
69 views

Exercise 6

This document contains code for a form with two buttons and menu items that change the text of a label. Button1 and the Hello menu item set the label text to "Hello!", while Button2 and the Goodbye menu item set the label text to "Goodbye!". The Exit menu item closes the application when clicked.

Uploaded by

api-307933689
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Exercise 6

Public Class Form1


Private Sub ExitToolStripMenuItem_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Handles ExitToolStripMenuItem.Click
Application.Exit()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
Label1.Text = "Hello!"
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button2.Click
Label1.Text = "Goodbye!"
End Sub
Private Sub HelloToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles HelloToolStripMenuItem.Click
Label1.Text = "Hello!"
End Sub
Private Sub GoodbyeToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles GoodbyeToolStripMenuItem.Click
Label1.Text = "Goodbye!"
End Sub
End Class

You might also like