Treads

G

Ghost

Hello.
How can I check if tread in Compact Framework is alive or how can I
interrupt it?
 
G

Guest

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
 
G

Ghost

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
 
G

Guest

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);
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top