Private Sub Command1_Click()
a=val(text1.text)
b=val(text2.text)
c=val(text3.text)
p=(a+b+c)/2
s=sqr(p*(p-a)*(p-b)*(p-c))
if a+b>唯则c and b+c>a and a+c>b then
text4.text="三角形的面积是:" &s
else
text4.text="不能皮谨构成三角形"
end if
end sub
下面是计算两数之和的代码
private sub command1_click()
a=val(text1.text)
b=val(text2.text)
text3.text=a+b
end sub
Dim a As IntegerDim b As Integer
Private Sub Command1_Click()
k = InStr(a, Text2, Text1)
If k >0 Then
Command1.Caption = "查找下一个或塌"
a = k + Len(Text1)
Text2.SetFocus
Text2.SelStart = k - 1
Text2.SelLength = Len(Text1)
b = b + 1
Else
MsgBox "昌肆查衫迅圆找完毕!共找到 " &b &" 个 " &Text1
Command1.Caption = "查找"
a = 1
End If
'Print k
End Sub
Private Sub Form_Load()
Label1 = "要查找的内容:"
Command1.Caption = "查找"
a = 1
End Sub
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)