标签:
//后台线程更新TextBox private void SetTextBox(TextBox txt, string value) { Action act = () => { txt.Text = value; }; if (txt.InvokeRequired) { txt.Invoke(act); } else { act(); } } private void TestThread() { int i = 0; while (true) { Thread.Sleep(1000); i++; SetTextBox(textBox2,i.ToString()); } }
标签:
原文地址:http://www.cnblogs.com/KQNLL/p/5213965.html