You use a timer to track time and run the next thing when you want it to.
But... you don't want to "pause" your program or have the timer loop for a period, becuase if I am not mistaken that will freeze your main thread and no animation will show.
Use multi-threading or background worker for the timer and the track of time.
I'm sure you'll find lots of tutorials in here.
adam_k
Veteran Poster
1,057 posts since Jun 2011
Reputation Points: 274
Solved Threads: 205
Skill Endorsements: 11
You can pause your application (the example here is for half a second) by
System.Threading.Thread.Sleep(500)
but what would be the point? All that you do is make your app unresponsive for the sleep time. VB programs are event driven. If you want some event to occur at set intervals then create a timer control and set the interval for the appropriate number of milliseconds. Put the code you want to execute in the timer Tick event.
Reverend Jim
Illigitimae non carborundum
3,743 posts since Aug 2010
Reputation Points: 585
Solved Threads: 470
Skill Endorsements: 33
You have to break up your code into subs. Each sub can be executed when a timer expires. You can't pause your code and have it continue to execute at the same time.
Reverend Jim
Illigitimae non carborundum
3,743 posts since Aug 2010
Reputation Points: 585
Solved Threads: 470
Skill Endorsements: 33