如何使计算控件所控制的TEXT控件允许为空呢?
如何使计算控件所控制的TEXT控件允许为空呢?Private Sub Command1_Click()
当这个TEXT控件不需要计算时?请看代码:
Dim x, y, c, ha, hb As Single
Dim x2, y2, c2, ha2, hb2 As Single
Dim x3, y3, c3, ha3, hb3 As Single
Dim x4, y4, c4, ha4, hb4 As Single
ha = Val(Text1.Text)
hb = Val(Text2.Text)
c = Val(Text3.Text)
y = 1000 * (ha - hb)
x = 500 * Sqr(c * c - (ha - hb) * (ha - hb))
Text10.Text = Val(x)
Text11.Text = Val(y)
ha2 = Val(Text2.Text)
hb2 = Val(Text4.Text)
c2 = Val(Text5.Text)
y2 = 1000 * (ha2 - hb2)
x2 = 500 * Sqr(c2 * c2 - (ha2 - hb2) * (ha2 - hb2))
Text12.Text = Val(x2)
Text13.Text = Val(y2)
。。。
。。。
End Sub