This Visual Basic code defines a form with five buttons and four text boxes. Button1 calculates the area of a circle based on the radius entered in TextBox1. Button2 clears all text boxes. Button3 closes the form. Button4 calculates the diameter of a circle based on the radius in TextBox1. Button5 calculates the circumference of a circle based on the radius in TextBox1.
This Visual Basic code defines a form with five buttons and four text boxes. Button1 calculates the area of a circle based on the radius entered in TextBox1. Button2 clears all text boxes. Button3 closes the form. Button4 calculates the diameter of a circle based on the radius in TextBox1. Button5 calculates the circumference of a circle based on the radius in TextBox1.
This Visual Basic code defines a form with five buttons and four text boxes. Button1 calculates the area of a circle based on the radius entered in TextBox1. Button2 clears all text boxes. Button3 closes the form. Button4 calculates the diameter of a circle based on the radius in TextBox1. Button5 calculates the circumference of a circle based on the radius in TextBox1.
This Visual Basic code defines a form with five buttons and four text boxes. Button1 calculates the area of a circle based on the radius entered in TextBox1. Button2 clears all text boxes. Button3 closes the form. Button4 calculates the diameter of a circle based on the radius in TextBox1. Button5 calculates the circumference of a circle based on the radius in TextBox1.
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim r, A As Single r = TextBox1.Text TextBox3.Text = (r ^ 2) * 3.1416 A = TextBox3.Text End Sub Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click Dim r, D As Single r = TextBox1.Text TextBox4.Text = r * 2 D = TextBox4.Text End Sub Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click Dim r, P As Single r = TextBox1.Text TextBox5.Text = (r * 2) * 3.1416 P = TextBox5.Text End Sub Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click TextBox1.Text = "" TextBox3.Text = "" TextBox4.Text = "" TextBox5.Text = "" End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click End End Sub End Class