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

Exercise 3

This Visual Basic code defines a form with two text boxes to accept numeric user input, and two labels to display the result of calculations on the input. When the button is clicked, it takes the values from the text boxes and stores them as integers, then performs multiplication of the integers and assigns the result to the first label. It also performs addition calculations and assigns the result to the second label. The exit menu item closes the form when clicked.

Uploaded by

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

Exercise 3

This Visual Basic code defines a form with two text boxes to accept numeric user input, and two labels to display the result of calculations on the input. When the button is clicked, it takes the values from the text boxes and stores them as integers, then performs multiplication of the integers and assigns the result to the first label. It also performs addition calculations and assigns the result to the second label. The exit menu item closes the form when clicked.

Uploaded by

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

Public Class Form1

Dim Num1 As Integer


Dim Num2 As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
Num1 = TextBox1.Text
Num2 = TextBox2.Text
Label5.Text = Num1 * Num2
Label6.Text = 2 * Num1 + 2 * Num2
End Sub
Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles ExitToolStripMenuItem.Click
Close()
End Sub
End Class

You might also like