Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
 
MSDN Visual Basic Community
 
 
 
 
 
TitleMake a timer fire each time the clock ticks off a minute
DescriptionThis 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.
Keywordstimer, clock, minute
CategoriesControls
 
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
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated