Task.Factory.StartNew(() => { Thread.Sleep(5000); this.Invoke(new Action(() => { this.button7.Text = "aaaaaaaaaaaaaa"; })); }); MessageBox.Show("1111111111111111");
//模态对话框阻塞主线程的话不影响其他线程操作主线程控件(不阻塞)
Task.Factory.StartNew(() => { Thread.Sleep(5000); this.Invoke(new Action(() => { this.button7.Text = "aaaaaaaaaaaaaa"; })); }); MessageBox.Show("1111111111111111");
//模态对话框阻塞主线程的话不影响其他线程操作主线程控件(不阻塞)