程式碼:
Dim a, b As Long 
______________________________________________________________________________________________________________________            
Private Sub Command1_Click()
Label1.Caption = Val(Label1.Caption) * 10 + 1
End Sub
________________________________________________
Private Sub Command10_Click()
Label1.Caption = ""
a = 0
End Sub

________________________________________________
Private Sub Command11_Click()
If b = "+" Then Label1.Caption = a + Val(Label1.Caption)
If b = "-" Then Label1.Caption = a - Val(Label1.Caption)
If b = "*" Then Label1.Caption = a * Val(Label1.Caption)
If b = "/" Then Label1.Caption = a / Val(Label1.Caption)
End Sub
_________________________________________________
Private Sub Command12_Click()
Label1.Caption = Val(Label1.Caption) * 10 + 0
End Sub
_________________________________________________
Private Sub Command13_Click()
a = Val(Label1.Caption)
b = "-"
Label1.Caption = "0"
End Sub
_________________________________________________
Private Sub Command14_Click()
a = Val(Label1.Caption)
b = "*"
Label1.Caption = "0"
End Sub
_________________________________________________
Private Sub Command15_Click()
a = Val(Label1.Caption)
b = "/"
Label1.Caption = "0"
End Sub
_________________________________________________
Private Sub Command16_Click()
a = Val(Label1.Caption)
b = "+"
Label1.Caption = "0"
End Sub
_________________________________________________
Private Sub Command2_Click()
Label1.Caption = Val(Label1.Caption) * 10 + 2
End Sub
_________________________________________________
Private Sub Command3_Click()
Label1.Caption = Val(Label1.Caption) * 10 + 3
End Sub
_________________________________________________
Private Sub Command4_Click()
Label1.Caption = Val(Label1.Caption) * 10 + 4
End Sub
_________________________________________________
Private Sub Command5_Click()
Label1.Caption = Val(Label1.Caption) * 10 + 5
End Sub
_________________________________________________
Private Sub Command6_Click()
Label1.Caption = Val(Label1.Caption) * 10 + 6
End Sub
_________________________________________________
Private Sub Command7_Click()
Label1.Caption = Val(Label1.Caption) * 10 + 7
End Sub
_________________________________________________
Private Sub Command8_Click()
Label1.Caption = Val(Label1.Caption) * 10 + 8
End Sub
_________________________________________________
Private Sub Command9_Click()
Label1.Caption = Val(Label1.Caption) * 10 + 9
End Sub
_________________________________________________
Private Sub Label1_Click()

End Sub

arrow
arrow
    全站熱搜

    愛爾 發表在 痞客邦 留言(2) 人氣()