Dim d As Byte
Dim e As Byte
Private Sub Command1_Click()
Timer1.Enabled = True
End Sub
Private Sub Command2_Click()
Timer1.Enabled = False
End Sub
Private Sub Command3_Click()
Timer1.Enabled = False
d = 0
e = 0
Label1.Caption = "0" & "0"
Label2.Caption = "0" & "0"
End Sub
Private Sub Form_Load()
Timer1.Enabled = False
Timer1.Interval = 1
End Sub
Private Sub Timer1_Timer()
d = d + 1
If d < 10 Then Label2.Caption = "0" & d
If d > 10 Then Label2.Caption = d
If d = 59 Then
d = 0
Label2.Caption = "0" & "0"
e = e + 1
End If
If e < 10 Then Label1.Caption = "0" & e
If e > 10 Then Label1.Caption = e
If e = 60 Then Label1.Caption = "0" & "0"
End Sub
Bạn đang đọc truyện trên: Truyen2U.Pro