hey,
sorry if this is a newbieish question but what I am attempting to do is create a timer that resets itself and starts again when it hits 0. The ammount of time is first entered by a user into a text box.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
jackPosted Jun 18, 2006, 1:34 AM
d gPosted Jun 17, 2006, 6:09 PM
I guess an example scenario might be... a form that has a timer, textbox, and button...
textbox could be defined to be minutes, or it could be parsed from some predefined format... anyways...
lets say the button defines a variable "minutes" which comes from the textbox text, and it sets a DateTime object to DateTime.Now, getting the current time. the button also activates the timer...
the timer's speed should be fast, but not so fast as to be wasteful... when the timer sees that
((TimeSpan)(DateTime.Now - time_when_user_pressed_button)).TotalMinutes
is greater than "minutes", then the timer can do stuff, like reset, turn itself off, etc, etc