2、用VB编写一个简单的计算器程序,实现两个数的加、减、乘、除。运行结果如下图2所示。
求源代码
我用的是VB2008
Dim a As Integer, b As Integer, c As Integer, char As Stringa = Val(Text1.Text)
b = Val(Text3.Text)
char = Text2.TextSelect Case char
Case "+"
c = a + b
Case "-"
c = a - b
Case "*"
c = a * b
Case "/"
c = a / b
End SelectLabel5.Caption = c追问
b = Val(Text3.Text)
char = Text2.TextSelect Case char
Case "+"
c = a + b
Case "-"
c = a - b
Case "*"
c = a * b
Case "/"
c = a / b
End SelectLabel5.Caption = c追问
你的理解力还真不错,vb6 到vb2008 呵呵
温馨提示:答案为网友推荐,仅供参考