Private Sub Command1_Click()
Dim x, y, c, ha, hb As Single
Dim x2, y2, c2, ha2, hb2 As Integer
Dim x3, y3, c3, ha3, hb3 As Integer
Dim x4, y4, c4, ha4, hb4 As Integer
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 = Int(Val(x))
Text11.Text = Int(Val(y))
If Text4.Text <> "" Then
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)
Else
Text12.Text = ""
Text13.Text = ""
End If
If Text6.Text <> "" Then
ha3 = Val(Text4.Text)
hb3 = Val(Text6.Text)
c3 = Val(Text7.Text)
y3 = 1000 * (ha3 - hb3)
x3 = 500 * Sqr(c3 * c3 - (ha3 - hb3) * (ha3 - hb3))
Text14.Text = Val(x3)
Text15.Text = Val(y3)
Else
Text14.Text = ""
Text15.Text = ""
End If
If Text8.Text <> "" Then
ha4 = Val(Text6.Text)
hb4 = Val(Text8.Text)
c4 = Val(Text9.Text)
y4 = 1000 * (ha4 - hb4)
x4 = 500 * Sqr(c4 * c4 - (ha4 - hb4) * (ha4 - hb4))
Text16.Text = Val(x4)
Text17.Text = Val(y4)
Else
Text16.Text = ""
Text17.Text = ""
End If
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Text13.Text = ""
Text14.Text = ""
Text15.Text = ""
Text16.Text = ""
Text17.Text = ""
End Sub
Private Sub Command3_Click()
End
End Sub
你自己试试