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.
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.
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.
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