Private Sub Command1_Click()
Dim a As Single,b As Single,c As Single,p As Single,s As Single
a = Val(Text1.Text)
b = Val(Text2.Text)
c = Val(Text3.Text)
p = (a + b + c) / 2
If a >= p Or b >= p Or c >= p Then
Label1.Caption = "不能构成三角形"
Else
s = Sqr(p * (p - a) * (p - b) * (p - c))
Label1.Caption = "面积为" & s
End If
End Sub