Computer Science Canada Workings over time.. |
Author: | Remm [ Sun Oct 08, 2006 9:14 am ] |
Post subject: | Workings over time.. |
How would I make it so that a number in a label / textbox will decrease every half a second no matter what you're doing..? Thanks! |
Author: | cool dude [ Sun Oct 08, 2006 11:13 am ] |
Post subject: | |
you have several choices. first choice make a loop but not that efficient. second choice use a timer. third and easiest choice would be to use the timer module that i showed here: http://www.compsci.ca/v2/viewtopic.php?t=13600 |
Author: | NikG [ Sun Oct 08, 2006 5:39 pm ] |
Post subject: | |
cool dude, that link sends you to a page where you mentions the sleep function... not very useful here. The timer control is the way to go. Just put the number reduction code in the Timer1_Timer sub. |
Author: | cool dude [ Sun Oct 08, 2006 9:20 pm ] |
Post subject: | |
NikG wrote: cool dude, that link sends you to a page where you mentions the sleep function... not very useful here.
The timer control is the way to go. Just put the number reduction code in the Timer1_Timer sub. hmm... do you know exactly how the sleep function works? you can easily put it in a loop so that it will decrease the number in the label box every half a second. if you want to use a timer you can as well, and i mentioned that, but this way works to. |
Author: | Silent Avenger [ Mon Oct 09, 2006 9:36 am ] |
Post subject: | |
I suggest if your making a fairly small program that doesn't need a whole lot of accuracy use the timer but if you need a fair amount of acuracy I think the sleep function is a better way to go. |
Author: | NikG [ Mon Oct 09, 2006 10:11 pm ] |
Post subject: | |
cool dude wrote: hmm... do you know exactly how the sleep function works? you can easily put it in a loop so that it will decrease the number in the label box every half a second. if you want to use a timer you can as well, and i mentioned that, but this way works to. Go reread your orig post.
cool dude wrote: third and easiest choice would be to use the timer module that i showed here: ... I got confused because the link goes to your SLEEP function, not TIMER MODULE.
But in any case, doesn't that other post mention that sleep pauses your entire program? If that's not the problem then fine... but if you want to continue using the vb prog while the timer is counting down (which is what I would want), then sleep is not a good solution! And frankly, I'd really wonder if sleep is indeed better than timer. |