} public void myStaticThreadMethod(int n) { for (int i = 0; i < n; i++) { this.Invoke((EventHandler)delegate { this.label1.Text ="gisoracle"+ n.ToString(); }); } } private void button1_Click(object sender, EventArgs e) { Thread thread1 = new Thread(() => myStaticThreadMethod(10)); thread1.Start(); // 只要使用Start方法,线程才会运行 }
C#一个简单的含参数,控件调用多线程调用
猜你喜欢
转载自www.cnblogs.com/gisoracle/p/12535017.html
今日推荐
周排行