想要學習怎么用VB寫一個計算器的看這里~~后面有代碼。效果視頻已經(jīng)發(fā)布啦
Dim st As
Sub ()
Rem 除
Text3.Text = Val(Text1.Text) / (Text2.Text)
If Text3.Text = 6 Or Text3.Text = 66 Or Text3.Text = 666 Then
. = True
Else: . = False
End If
End Sub
Sub ()
Rem 乘
Text3.Text = Val(Text1.Text) * Val(Text2.Text)
If Text3.Text = 6 Or Text3.Text = 66 Or Text3.Text = 666 Then
. = True
Else: . = False
End If
End Sub
Sub ()
Rem 加
Text3.Text = Val(Text1.Text) + Val(Text2.Text)
If Text3.Text = 6 Or Text3.Text = 66 Or Text3.Text = 666 Then
. = True
Else: . = False
End If
End Sub
Sub ()
Rem 減
Text3.Text = Val(Text1.Text) - Val(Text2.Text)
If Text3.Text = 6 Or Text3.Text = 66 Or Text3.Text = 666 Then
. = True
Else: . = False
End If
End Sub
Sub ()
Rem 清除
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
. = False
End Sub
Sub ()
Rem 保存
st = Text3.Text
Text1.Text = st
End Sub
Sub ()
'粘貼
Text1.Text = ""
Text1.Text = st
End Sub
Sub ()
End Sub