Private Sub Command1_Click()
Dim x As Integer, y As Integer
If IsNumeric(Text1.Text) = Flase Or Text1.Text = "" Then Exit Sub
If IsNumeric(Text2.Text) = Flase Or Text2.Text = "" Then Exit Sub
x = Val(Text1.Text) + Val(Text2.Text)
Text3.Text = x
End Sub
text属性是 字符串 就算你输入数字 也是字符串形式的数字 需要转换为数值型数据 才能四则运算