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

Exercise 6

This Visual Basic code defines a form with four text boxes to collect numeric input from users and one label. When the button is clicked, it takes the values from each text box, adds them together, and divides the total by four to calculate the average value which is then displayed in the label. It also includes an exit menu item that closes the form when clicked.

Uploaded by

api-310300017
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)
78 views

Exercise 6

This Visual Basic code defines a form with four text boxes to collect numeric input from users and one label. When the button is clicked, it takes the values from each text box, adds them together, and divides the total by four to calculate the average value which is then displayed in the label. It also includes an exit menu item that closes the form when clicked.

Uploaded by

api-310300017
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

Public Class Form1

Dim one As Decimal


Dim two As Decimal
Dim three As Decimal
Dim four As Decimal
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
one = TextBox1.Text
two = TextBox2.Text
three = TextBox3.Text
four = TextBox4.Text
Label6.Text = (one + two + three + four) / 4
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