viper2843 Posted September 12, 2004 Posted September 12, 2004 (edited) I am trying to create a countdown clock for my Pocket PC and I have to working for the most part but the timer is very unreliable and I can't figure out why. It goes very fast for some reason. It went from a 1 minute countdown in about 16 seconds. Can anyone help me? I have included the code.LaundryTimer.zip Edited September 12, 2004 by PlausiblyDamp Quote
viper2843 Posted September 17, 2004 Author Posted September 17, 2004 Any help would be greatly appreciated. Thanks. Quote
TamuTamu Posted October 3, 2004 Posted October 3, 2004 Interval = Milleseconds I put in 60 and got the timer event hitting every 60 milleseconds, when you apply the timer.Interval value you want it to be tripping very second yea? Then it should be done like this..... private int seconds = 60; private void SomeBeginningMethod() { Timer t = new Timer(); t.Interval = 1000;//takes a milleseconds value t.Tick+=new EventHandler(t_Tick); t.Enabled = true; } private void t_Tick(object sender, System.EventArgs e) { seconds--; if(seconds<1) { MessageBox.Show("Out of seconds"); Timer t = (Timer)sender; t.Enabled = false; t.Dispose(); } } Quote
viper2843 Posted October 4, 2004 Author Posted October 4, 2004 Thanks for your help. Your example helped me out. I have now figured it out. Thanks again. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.