Private Sub Command1_Click()
Dim sum1
txt1 = Split(Text1.Text, vbCrLf) '按行进行分割
Text1.Text = ""
For i = 0 To UBound(txt1)
If InStr(txt1(i), "+") Then
sum1 = Split(txt1(i), "+")
Text1.Text = Text1.Text & txt1(i) & "=" & Val(sum1(0)) + Val(sum1(1)) & vbCrLf
End If
If InStr(txt1(i), "-") Then
sum1 = Split(txt1(i), "-")
Text1.Text = Text1.Text & txt1(i) & "=" & Val(sum1(0)) - Val(sum1(1)) & vbCrLf
End If
If InStr(txt1(i), "*") Then
sum1 = Split(txt1(i), "*")
Text1.Text = Text1.Text & txt1(i) & "=" & Val(sum1(0)) * Val(sum1(1)) & vbCrLf
End If
If InStr(txt1(i), "/") Then
sum1 = Split(txt1(i), "/")
Text1.Text = Text1.Text & txt1(i) & "=" & Val(sum1(0)) / Val(sum1(1)) & vbCrLf
End If
Next
End Sub