|
|
Title | Make a timer fire each time the clock ticks off a minute |
Description | This example shows how to make a timer fire each time the clock ticks off a minute in Visual Basic 6. Each time the Timer fires, the code resets its Interval property so it fires again on the next minute. |
Keywords | timer, clock, minute |
Categories | Controls |
|
|
Thanks to Mike H.
Use a Timer and reset its Interval property each time it fires so it fires again on the next minute.
|
|
Private Sub tmrClock_Timer()
lblClock.Caption = Format$(Time)
' Reset the timer so it fires just after
' the clock ticks the next minute.
tmrClock.Interval = (60 - (Int(Timer) Mod 60)) * 1000
End Sub
|
|
|
|
|
|