this.invoke
Thread thread = new Thread(new ThreadStart(delegate
{
for (int i = 0; i < 100; i++)
{
this.Invoke(new MethodInvoker(delegate
{
if (i == 99)
{
this.label1.Visible = false;
this.label1.Refresh();
}
this.label1.Text = i.ToString();
this.label1.Refresh();
}));
}
}));
thread.IsBackground = true;
thread.Start();
{
for (int i = 0; i < 100; i++)
{
this.Invoke(new MethodInvoker(delegate
{
if (i == 99)
{
this.label1.Visible = false;
this.label1.Refresh();
}
this.label1.Text = i.ToString();
this.label1.Refresh();
}));
}
}));
thread.IsBackground = true;
thread.Start();