i am a beginner to visual basic 5 and need to know how to make a timer- not the timer in VB but a timer which counts down to zero and then i'll tell VB what to do. If you can help me, please let me know.
Justin, a link on a site called Planet SourceCode - the link picks up at 1 0f 414 listings for the word 'timer'. Consider this - you are only in need of a timed event to spawn the next event and not necessarily a count-down.
Happy Hunting!
Timer Function Example
This example uses the Timer function to pause the application. The example also uses DoEvents to yield to other processes during the pause.
Dim PauseTime, Start, Finish, TotalTime
If (MsgBox("Press Yes to pause for 5 seconds", 4)) = vbYes Then
PauseTime = 5 ' Set duration.
Start = Timer ' Set start time.
Do While Timer < Start + PauseTime
DoEvents ' Yield to other processes.
Loop
Finish = Timer ' Set end time.
TotalTime = Finish - Start ' Calculate total time.
MsgBox "Paused for " & TotalTime & " seconds"
Else
End
End If
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.