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

Exercise 3

This Visual Basic code defines a form with two text boxes and two labels. When the Exit menu item is clicked, the application closes. When Button1 is clicked, it takes the values from the two text boxes, converts them to numbers, multiplies them and displays the result in Label1, adds the values and displays in Label2.

Uploaded by

api-307933689
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views

Exercise 3

This Visual Basic code defines a form with two text boxes and two labels. When the Exit menu item is clicked, the application closes. When Button1 is clicked, it takes the values from the two text boxes, converts them to numbers, multiplies them and displays the result in Label1, adds the values and displays in Label2.

Uploaded by

api-307933689
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Exercise 3

Public Class Form1


Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
Application.Exit()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
Label1.Text = Val(TextBox1.Text) * Val(TextBox2.Text)
Label2.Text = Val(TextBox1.Text) + Val(TextBox2.Text)
End Sub
End Class

You might also like