12-29-2009, 07:46 AM
I'm assuming for number 2 you want to resume the countdown where it left off. In this case you should make a total of 3 buttons, Start, Pause/Resume (or Stop/Resume), and Reset.
You want the Start button to obviously start the countdown. Now your Pause button will temporarily pause the countdown where its at AND it will resume your countdown. Your Reset button will turn the countdown off and reset it to 0(zero) for a new countdown.
Ok, let's say your countdown Starts at 100, a few moments later its at....80. Now you want to hit the Pause/Resume button and it will "freeze" the time in its place. To have your Pause/Resume function to work properly I would suggest using a boolean.
An example would be:
I hope this help's you on your project! Please PM me if you need additional assistance.
You want the Start button to obviously start the countdown. Now your Pause button will temporarily pause the countdown where its at AND it will resume your countdown. Your Reset button will turn the countdown off and reset it to 0(zero) for a new countdown.
Ok, let's say your countdown Starts at 100, a few moments later its at....80. Now you want to hit the Pause/Resume button and it will "freeze" the time in its place. To have your Pause/Resume function to work properly I would suggest using a boolean.
An example would be:
Code:
**NOTE** THIS IS C# SYNTAX WHICH IS VERY SIMILAR TO VB.NET
bool countdownPause = false;
//Now when your button is clicked you want to change your bool
//countdown to true.
//When the countdown is true the timer will Pause until countdownPause
//bool is false.
I hope this help's you on your project! Please PM me if you need additional assistance.