Treads

  • Thread starter Thread starter Ghost
  • Start date Start date
G

Ghost

Hello.
How can I check if tread in Compact Framework is alive or how can I
interrupt it?
 
You can use the control.invoke method to access an event handler in the
thread and use it to kill the thread that has that control.

Ali Gardezi
 
How?
Can you show me some examples please?

Ali said:
You can use the control.invoke method to access an event handler in the
thread and use it to kill the thread that has that control.

Ali Gardezi
 
BusyScreen bs; //The busy screen form displayed in a seperate thread

Thread t=new Thread(runThread)
t.start();
/*Do something else in main thread. When you want to stop the above
*thread (assuming the BusyScreen class has a method called
*KillMe(object o ,EventArgs e) which calls this.Dispose(); and this.Close();
*in order to stop the form and kill the thread
*/
bs.invoke(new EventHandler(bs.KillMe));

public static void runThread()
{
bs=new BusyScreen();
Application.Run(bs);
}
 
Back
Top