日期:2014-05-17 浏览次数:21197 次
//windows ce 的winform 不能使用异步委托 private void linkLabel_Click(object sender, EventArgs e) { Thread t = new Thread(new ThreadStart(DoWork)); t.IsBackground = true; t.Start(); } private delegate void MyDelegate(); string ss=""; private void DoWork() { //....... ss ="abcd"; if (this.label6.InvokeRequired) { Invoke(new MyDelegate(MyMethod)); } } private void MyMethod() { label6.Text = ss; }