110,539
社区成员
发帖
与我相关
我的任务
分享
Task t = new Task(() =>
{
for (int i = 0; i < 10; i++)
{
this.textBox2.Invoke(new Action (() => { this.textBox2.Text = i.ToString(); })); //True
System.Threading.Thread.Sleep(500);
Application.DoEvents();
}
});
//t.RunSynchronously();
t.Start();
//t.Wait();
Console.WriteLine("Status:" + t.Status);
Task t = new Task(() =>
{
for (int i = 0; i < 10; i++)
{
this.textBox2.Invoke(new Action (() => { this.textBox2.Text = i.ToString(); })); //True
System.Threading.Thread.Sleep(500);
Application.DoEvents();
Console.WriteLine("Status:" + t.Status);
}
});
t.Start();