Private Function ADD(ByRef x As Integer, ByRef y As Integer) As Integer
ADD = x + y
End Function
Private Function Multi(x As Integer, y As Integer) As Integer
Multi = x * y
End Function
Private Sub Command1_Click()
x = CInt(InputBox("请输入x的值:", "赋值"))
y = CInt(InputBox("请输入y的值:", "赋值"))
Sum = ADD(Int(x), Int(y))
Text1.Text = CStr(x) + "+" + CStr(y) + "=" + CStr(Sum)
End Sub
Private Sub Command2_Click()
x = CInt(InputBox("请输入x的值:", "赋值"))
y = CInt(InputBox("请输入y的值:", "赋值"))
cheng = Multi(Int(x), Int(y))
Text1.Text = CStr(x) + "*" + CStr(y) + "=" + CStr(cheng)
End Sub