restarting second counter
-
hi, i have a counter that counts down from 5 minutes. i have 2 separate displays: 1. minute display(which counts down every 60 seconds), 2. seconds display(which counts down from a minute i.e. 00, 59, 58 ....). what i cant figure out is how to make the second counter to restart at 00 after a minute has gone by. can anyone help me? thanks. Sincerely, Jason C. Ranin Software Quality Assurance
-
hi, i have a counter that counts down from 5 minutes. i have 2 separate displays: 1. minute display(which counts down every 60 seconds), 2. seconds display(which counts down from a minute i.e. 00, 59, 58 ....). what i cant figure out is how to make the second counter to restart at 00 after a minute has gone by. can anyone help me? thanks. Sincerely, Jason C. Ranin Software Quality Assurance
Why do you need two counters? Why not just have one counter counting the seconds? Assuming your counter variable is called
counter
, each time the timer fires you increment it. To get the seconds and minutes try:int seconds = counter % 60;
int minutes = counter / 60;
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar The Second EuroCPian Event will be in Brussels on the 4th of September Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way! My Blog