|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
按重复数字行 但是按加减乘除就不行了 请高手指导下
QQ截图20121105204546.png[img]QQ截图20121105204546.png[/img]
Dim a As Integer
Dim s As String
Private Sub Command1_Click()
Text1.Text = Text1.Text & Command1.Caption
End Sub
Private Sub Command10_Click()
Text1.Text = Text1.Text & Command10.Caption
End Sub
Private Sub Command11_Click()
Text1.Text = ""
End Sub
Private Sub Command12_Click()
On Error Resume Next
If s = "+" Then
Text1.Text = Val(Text1.Text) + a
ElseIf s = "-" Then
Text1.Text = a - Val(Text1.Text)
ElseIf s = "*" Then
Text1.Text = Val(Text1.Text) * a
ElseIf s = "/" Then
Text1.Text = a / Val(Text1.Text)
End If
End Sub
Private Sub Command13_Click()
a = Text1.Text
Text1.Text = ""
s = "+"
End Sub
Private Sub Command14_Click()
a = Text1.Text
Text1.Text = ""
s = "-"
End Sub
Private Sub Command15_Click()
a = Text1.Text
Text1.Text = ""
s = "*"
End Sub
Private Sub Command16_Click()
a = Text1.Text
Text1.Text = ""
s = "/"
End Sub
Private Sub Command2_Click()
Text1.Text = Text1.Text & Command2.Caption
End Sub
Private Sub Command3_Click()
Text1.Text = Text1.Text & Command3.Caption
End Sub
Private Sub Command4_Click()
Text1.Text = Text1.Text & Command4.Caption
End Sub
Private Sub Command5_Click()
Text1.Text = Text1.Text & Command5.Caption
End Sub
Private Sub Command6_Click()
Text1.Text = Text1.Text & Command6.Caption
End Sub
Private Sub Command7_Click()
Text1.Text = Text1.Text & Command7.Caption
End Sub
Private Sub Command8_Click()
Text1.Text = Text1.Text & Command8.Caption
End Sub
Private Sub Command9_Click()
Text1.Text = Text1.Text & Command9.Caption
End Sub
|
|