'球的体积
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If TextBox1.Text = "" Then Return
Dim r As Single = CSng(TextBox1.Text)
Dim V As Single = 4 / 3 * Math.PI * r ^ 3
Label2.Text = V.ToString
End Sub
'圆的周长和面积
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If TextBox1.Text = "" Then Return
Dim r As Single = CSng(TextBox1.Text)
Dim C As Single = 2 * Math.PI * r
Dim S As Single = Math.PI * r ^ 2
Label2.Text = C.ToString & " " & S.ToString
End Sub