Hello all
In VB6 I could pause an event by using the PauseTime property "eg: PauseTime = 0.01). How do you pause time in VB 2005 Express
Thanks all
Hello all
In VB6 I could pause an event by using the PauseTime property "eg: PauseTime = 0.01). How do you pause time in VB 2005 Express
Thanks all
PauseTime
Phm
What do you want to achieve
Although, you can sleep the current thread via Thread.Sleep, doing this on the main thread is typically a bad thing as this will prevent Windows messages from being processed, and to the user it will seem like your application has locked up.
DIG
Use the System.Windows.Forms.Timer class, you can simply drag one of these onto your form from the Toolbox.
This class simply fires an event at a specific interval.
Fylar
I would think more about using a timer control and implementing something in the tick event than using a threading sleep. Using threading sleep would make this application pretty unresponsive.
The timer design would say every (tick interval) calculate and move object to its new position. This would execute the move every interval and to speed it up or slow it down you would simply adjust the interval property. The rest of the UI would still be responsive whilst this was occuring.
Tasnim
Thanks for the response.
What I'm after is to move an image slowly from point a to point b. When I say slowly, I'm talking seconds. In VB6, I achieved this by using a 'TimeOut' of 0.01 (or some similar number depending on the speed of movement required) within a 'for next' loop (for x = 1 to 2000 etc) which, without the pause, would obviously move the image from point a to point b in an instant. This pause method moved the image top (or image left) by a small amount (the TimeOut enabling me to achieve this quite smoothly) until the image was at the correct position, at which point the programme moved out of the loop. I also used this method to scroll messages slowly across the screen, similar to a ticker-bar you see now on every tv news channel. I'm sure there are better ways of doing all this in VB6 but it worked pretty well for me. Anywho, I'd just like a leg-up as to how to achieve it in Express.
Thanks again
Ryan Lederman