Threads and Timers

zahadumy

New member
Joined
Mar 7, 2006
Messages
1
Programming Experience
Beginner
I have a class where I use a timer. From another class, I create some threads and declare an instance of the class where I use the Timer. The problem is the Timer_Tick event doesn't execute any more. :confused: Do you have any ideas why?
The timer works just fine if I don't use threads, so the problem is working with threads... Thank you.
 
I am guessing (because you are posting in a windows froms forum) that there is a windows form being used and that this is the class with the standard drag&drop forms timer control. It is undesirable to use a thread that you launch to handle user-interface elements. See if you can use a form to call the routine that creates the threads to avoid problems and lockups in the user interface. As you are using threads make sure that you are using System.Threading.Timer or System.Timer or System.Timers.Timer as they are thread compatible.
 
Back
Top