• Advertisement
Sign in to follow this  

VB.Net : Pausing the Program momentarily

This topic is 3826 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hey all, I was wondering how you can program a game so that after it executes a function it waits for a second or two before it moves onto its next function? for example if i were programming a label to have text in it after a triggered event, have it wait one second before it displays some more text within it replacing the old text. because i dont know how to do this it is just displaying the last text set because of the speed of the program. Does anyone know how i can pause my program momentarily? Thanks

Share this post


Link to post
Share on other sites
Advertisement
You could use a Timer component. When you set the text, start the timer, and when the timer's Tick event fires, do whatever you want to do next.

Share this post


Link to post
Share on other sites
Yes a Timer (either the timer control or the timer class) would be the easiest, otherwise you'd be getting into threading. Drop a timer control onto your winform and set Enabled to true, and the interval to 1000 (interval is in 1/1000th of a second, so 1000/1000 is 1 second). Then put your code in the timer's Tick event.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement