scyleia Posted August 15, 2003 Posted August 15, 2003 This is my first post here :D..... i have this problems with timer and threads ex : i have timer named timer1 in Form1. in Keydown event i set timer1.Enabled = true. the problems occur when i press the key for a while and.. what's happen?? timer1 is stopped dunno what happen it's just stopped the same thing happen when i have Thread instead of Timer can anybody explain this to me.... Quote
*Experts* Volte Posted August 15, 2003 *Experts* Posted August 15, 2003 What code do you have in Timer1? Quote
scyleia Posted August 15, 2003 Author Posted August 15, 2003 label1.Text = DateTime.Now.ToLongString(); -> i have label1 in Form1 Quote
scyleia Posted August 15, 2003 Author Posted August 15, 2003 my plan is when i push a key... i start a thread/timer then when keyUp i stop it. So this timer/thread has to run while i press a key but what i got here is... it run for a while and then stop.... so can't use KeyUp event :( Quote
Photovoltaic Posted August 16, 2003 Posted August 16, 2003 Are you using the same key each time? If so, try another one (it might be a keyboard issue). You could replace the code in your timer with the Beep() function, change the interval to 100, and check to see if the time it takes to stop is always the same or if a pattern appears. Quote
scyleia Posted August 16, 2003 Author Posted August 16, 2003 sorry guys... i think i know what the problem is. when keydown i start the thread over and over and over :eek: so i just give some flag and zapp.....!!! it works :D Photovoltaic : yes it stop with same pattern thank you for all the answer it means a lot ;) 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.