private void CheckA() { System.Threading.ThreadPool.QueueUserWorkItem(t => { ShowInfo("檢測開始....."); System.Threading.Thread.Sleep(3000); ShowInfo("暫停3秒結束....."); System.Threading.Thread.Sleep(2000); ShowInfo("暫停2秒結束....."); System.Threading.Thread.Sleep(1000); ShowInfo("檢測結束"); }); } private void ShowInfo(string Info) { listView1.Invoke(new Action(() => { listView1.Columns[0].Width = listView1.ClientSize.Width; listView1.Items.Insert(0, new ListViewItem(Info)); })); }
