|
|
|
| Title | Make a timer wait a long time between events |
| Keywords | timer, long timer, wait |
| Categories | Controls |
|
|
|
Store the next event time in a variable. Use a timer to check periodically to see if the time has arrived.
|
|
Private Sub tmrTrigger_Timer()
' See if it time for the event.
If Timer >= NextEventTime Then
' Process the event.
lblEventTime.Caption = Format$(DateAdd("s", _
INTERVAL_SECONDS, Time))
' Set the new event time.
NextEventTime = NextEventTime + INTERVAL_SECONDS
End If
' Set the timer's interval.
If NextEventTime - Timer < 60 Then
tmrTrigger.Interval = (NextEventTime - Timer) * 1000
Else
tmrTrigger.Interval = 60000
End If
End Sub
|
| |
 |
| |
|
|