This code defines a form with text boxes for entering a person's first name, last name, phone number, age, and gender. When button one is clicked, the values from the text boxes are assigned to variables and displayed in labels. Button two clears the text from all text boxes when clicked, allowing new information to be entered.
This code defines a form with text boxes for entering a person's first name, last name, phone number, age, and gender. When button one is clicked, the values from the text boxes are assigned to variables and displayed in labels. Button two clears the text from all text boxes when clicked, allowing new information to be entered.
This code defines a form with text boxes for entering a person's first name, last name, phone number, age, and gender. When button one is clicked, the values from the text boxes are assigned to variables and displayed in labels. Button two clears the text from all text boxes when clicked, allowing new information to be entered.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click Dim firstname As String = "" Dim surname As String = "" Dim phone As Integer = 0 Dim age As Integer = 0 Dim gender As String = "" firstname = TextBox1.Text surname = TextBox2.Text phone = TextBox3.Text age = TextBox4.Text gender = TextBox5.Text Label8.Text = TextBox1.Text & TextBox2.Text Label9.Text = TextBox3.Text Label10.Text = TextBox4.Text Label11.Text = TextBox5.Text End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button2.Click TextBox1.Text = "" TextBox2.Text = "" TextBox3.Text = "" TextBox4.Text = "" TextBox5.Text = "" End Sub End Class