1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
| Dim x As Integer
Private Sub Command1_Click()
Timer1.Enabled = True
Timer1.Interval = 1000
If (x = 0) Then
Label2.Caption = 10
End If
x = x + 1
If Label2.Caption = 0 Then
Timer1.Enabled = False
Command1.Enabled = False
Command3.Enabled = True
End If
Label1.Caption = x
End Sub
Private Sub Command2_Click()
'CD1.ShowColor
'Me.BackColor = CD1.Color
End Sub
Private Sub Command3_Click()
Label2.Caption = "Timer"
Label1.Caption = 0
Command3.Enabled = False
Command1.Enabled = True
x = 0
End Sub
Private Sub Form_Load()
End Sub
Private Sub Timer1_Timer()
Label2.Caption = Label2.Caption - 1
End Sub |