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.
Looping timer?
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
d g19 pointsPosted Jun 17, 2006, 2:09 PM EDT
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
jack3 pointsPosted Jun 17, 2006, 9:34 PM EDT