計算機

| 物件名稱 | 標題 |
| From1 | 效果 |
| Command1(0) | 0 |
| Command1(1) | 1 |
| Command1(2) | 2 |
| Command1(3) | 3 |
| Command1(4) | 4 |
| Command1(5) | 5 |
| Command1(6) | 6 |
| Command1(7) | 7 |
| Command1(8) | 8 |
| Command1(9) | 9 |
| Command2(0) | 0 |
| Command2(1) | 1 |
| Command2(2) | 2 |
| Command2(3) | 3 |
| Command3 | = |
| Command4 | C |
| Label2 | 時間 |
| Timer1 | timer |
Dim op1 As Long
Dim op2 As Long
Dim mycount As Integer
Dim myclear As Boolean
Private Sub Command1_Click(Index As Integer)
Label1.Caption = Val(Label1.Caption & Str(Index))
If (myclear = True) Then
myclear = False
End If
End Sub
Private Sub Command2_Click(Index As Integer)
mycount = Index
op1 = Val("Label1.Caption")
myclear = True
End Sub
Private Sub Command3_Click()
op2 = Label1.Caption
Select Case mycount
Case 0
Label1.Caption = op1 + op2
Case 1
Label1.Caption = op1 - op2
Case 2
Label1.Caption = op1 * op2
Case 3
Label1.Caption = op1 / op2
End Select
End Sub
Private Sub Command4_Click()
Label1.Caption = "0"
op1 = 0
op2 = 0
myclear = False
mycount = -1
End Sub
Private Sub Form_Activate()
Timer1.Interval = 1000
End Sub
Private Sub Form_Load()
Timer1.Interval = 0
End Sub
Private Sub Label2_Click()
Timer1.Enabled = False
End Sub
Private Sub Label2_DblClick()
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
Label2.Caption = Time
End Sub
Previous in This Category: 調色盤 Next in This Category: 大樂透
想要自由 想要快樂