Private Sub cmddsignchange_Click () 'add a plus or minus
Dim data As an Integer
Data=https://bbs.csdn.net/topics/Val (Txtscreen. Text)
Length=Len (Txtscreen. Text)
If the data & gt; 0 Then
Txtscreen. Text=data * (1)
The Else
Txtscreen. Text=Right (Txtscreen. Text, length - 1)
End the If
End Sub
Private Sub cmdequ_Click () '="
Dim the result As a Double
Dim second As Double
Second=Val (Txtscreen. Text)
Sign=Index
The Select Case sign
Case 0
Result=first + second
Case 1
Result=first - second
Case 2
Result=first * second
Case 3
If the second=0 Then
MsgBox "divisor cannot be zero
"The Else
Result=first/second
End the If
End the Select
Txtscreen. Text=CStr (result)
End Sub
Private Sub cmdnumber_Click (Index As an Integer)
If Txtscreen. Text="0" Then
Txtscreen. Text=CStr (Index)
The Else
Txtscreen. Text=Txtscreen. Text & amp; CStr (Index)
End the If
End Sub
Private Sub Cmdon_Click ()
Txtscreen. Text="0"
End Sub
Private Sub cmdoperater_Click (Index As an Integer)
Dim first As a Double
First=Val (Txtscreen. Text)
Txtscreen. Text="0"
End Sub
Private Sub cmdpoint_Click ()
Txtscreen. Text=Txtscreen. Text & amp; ". "
End Sub
Private Sub Form_Load ()
For the Index=0 To 9
Cmdnumber (Index). Caption=cmdnumber (Index). The Index
Next the Index
End Sub
CodePudding user response:
http://download.csdn.net/download/stu_fly/4149067http://download.csdn.net/detail/joeyu2009/1742268
http://download.csdn.net/detail/asd155655153/3421259
http://download.csdn.net/download/abcemituofo/833793
http://download.csdn.net/download/tony19810929/933182