I have a Form with a Label with text "Loading".
label1.Text = "Loading...";
In Form.Load I have a new Thread which is doing something, lets say this.
void Form_Load(object sender, EventArgs args)
{
Thread t = new Thread(run);
t.Start();
}
void run()
{
for(int i = 0; i < 1000000; i++)
{
}
}
I want to change label1.Text
property to "Finished" after the completion of Thread "t". But where and how to change I don't have any idea. I am learning Threads. Do I have to create one more thread to do this which continouously checks the isAlive
property of Thread "t"?