有一道是这样的:VB中常量的应用,编写计算圆的周长和面积的程序,可是我做了总计算不对,等于0,想问一下,为什么?谢谢!
Dim x As Double
Dim b As Double
Private Sub Command1_Click()
b = 2 * 3.14159 * r
Text2.Text = CDbl(b)
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If IsNumeric(Text1.Text) Then
r = CDbl(Text1.Text)
End If
End If
End Sub