VB.Net : Pausing the Program momentarily
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
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement