求助!!小弟初学VB 编写了一个计算器 出问题了
我的代码是这样写的:
Private Sub cmd1_Click()
Dim x As Currency
Dim y As Currency
x = txt1.Text
y = txt2.Text
txt3.Text = x + y
End Sub
Private Sub cmd2_Click()
Dim x As Currency
Dim y As Currency
x = txt1.Text
y = txt2.Text
txt3.Text = x - y
End Sub
Private Sub cmd3_Click()
Dim x As Currency
Dim y As Currency
x = txt1.Text
y = txt2.Text
txt3.Text = x * y
End Sub
Private Sub cmd4_Click()
Dim x As Currency
Dim y As Currency
x = txt1.Text
y = txt2.Text
txt3.Text = x / y
End Sub
Private Sub cmd5_Click()
End
End Sub
数字加减乘除都没问题 但就是输入字母或者汉字出现“运行错误‘13’类型不匹配”的字样 就自动退出
或者不输入直接点击命令按钮 也出现这样的字样 我该怎么改写代码呢?