Quote:
Originally Posted by Naworia
Thank you for your both replies. I used them but i can't create a "Thread" for timer1_Tick.
It says an error about "No overload".
I sued this code :
Code:
Thread Loop1Thread = new Thread(new ThreadStart(timer1_Tick));
|
Please give more details on errors next time.
I guess the error occurs because the Tick event handlers commonly take two arguments:
Code:
void Timer1_Tick(Object sender, EventArgs e);
There is no candidate taking no arguments.
You will have to pass all parameters for the threaded method in one object (when calling the Start() method). However, you can also overload the Timer1_Tick method to handle no arguments (or one object which could include an array of arguments).
Easiest way would be a method simply calling the Timer1_Tick method.
Code:
public void Timer1_Tick(Object sender, EventArgs e)
{
... your original Tick method
}
public void Call_Timer1_Tick()
{
this.Timer1_Tick(null, null);
}
Watch out: untested.