This Visual Basic code defines a class with a button click event handler that calculates the area of a circle. It prompts the user to enter a radius value, calculates the area using the radius and pi, and displays the result in a message box.
This Visual Basic code defines a class with a button click event handler that calculates the area of a circle. It prompts the user to enter a radius value, calculates the area using the radius and pi, and displays the result in a message box.
This Visual Basic code defines a class with a button click event handler that calculates the area of a circle. It prompts the user to enter a radius value, calculates the area using the radius and pi, and displays the result in a message box.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click Dim area As Double Dim radius As Single Const pi = 3.142 radius = InputBox("enter radius") area = pi * radius ^ 2 area = MsgBox("area is" & area) End Sub End Class