求VB编程代码,具体情况是这样的:在一个文本框中输入四则运算,并输出,请高手帮忙。我的QQ是1365241914
Private Sub Command1_Click()
On Error GoTo ErrHandle
Select Case Combo1.ListIndex
Case 0
Text3.Text = Val(Text1.Text) + Val(Text2.Text)
Case 1
Text3.Text = Val(Text1.Text) - Val(Text2.Text)
Case 2
Text3.Text = Val(Text1.Text) * Val(Text2.Text)
Case 3
Text3.Text = Val(Text1.Text) / Val(Text2.Text)
End Select
Exit Sub
ErrHandle:
Exit Sub
End Sub
Private Sub Form_Load()
Combo1.Clear
Combo1.AddItem "+"
Combo1.AddItem "-"
Combo1.AddItem "*"
Combo1.AddItem "/"
Combo1.ListIndex = 0
End Sub