VB软件编程
能不能给个计算器的代码 只要+-的计算器
能不能给个计算器的代码 只要+-的计算器
答案:这是运行时的图片,需要什么控件对照这图上的来吧
代码在这下面:
Private Sub Form_Load()
Option1.Value = True '默认为“+”运算
End Sub
Private Sub Command1_Click() '“计算”按钮
Dim a As Single, b As Single, t As Single, s As String
a = Val(Text1.Text)
b = Val(Text2.Text)
Select Case True
Case Option1.Value ' + 运算
s = "+"
t = a + b &