自己编写的VB计算器,以下是代码
Private Sub Command1_Click()
a = Val(Text1.Text)
b = Val(Text2.Text)
c = a + b
Text3.Text = c
End Sub
Private Sub Command2_Click()
a = Val(Text1.Text)
b = Val(Text2.Text)
c = a - b
Text3.Text = c
End Sub
Private Sub Command3_Click()
a = Val(Text1.Text)
b = Val(Text2.Text)
c = a * b
Text3.Text = c
End Sub
Private Sub Command4_Click()
a = Val(Text1.Text)
b = Val(Text2.Text)
c = a / b
Text3.Text = c
End Sub