A simple timer that starts and stops incrementing seconds by use of a command button.
A simple timer that starts and stops incrementing seconds by use of a command button.
API Declarations
'Feb. 27, 2001
'[email protected]
'example using Timer control to increment in seconds
'**********************************************************
'general declarations
Dim intSecond As Integer
Rate A simple timer that starts and stops incrementing seconds by use of a command button.
(2(2 Vote))
If Timer1.Enabled = True Then
Timer1.Enabled = False
cmdStartStop.Caption = "START THE TIMER"
lblTimer.Caption = intSecond
Else: Timer1.Enabled = True
cmdStartStop.Caption = "STOP THE TIMER"
End If
End Sub
Private Sub Timer1_Timer()
'this code is executed with every interval of
'1000 milliseconds or every one second
If Timer1.Enabled = True Then
lblTimer.Caption = intSecond
intSecond = intSecond + 1 'increment the seconds
End If
End Sub
A simple timer that starts and stops incrementing seconds by use of a command button. Comments
No comments yet — be the first to post one!
Post a Comment