达到这一目的的方法如下:
1
2 public class MyForm : Form
3 {
4 public void OnDataChanged(object obj, EventArgs args)
5 {
6 this.Invoke((MethodInvoker)delegate
7 {
8 label1.Text = "test";
9 }
10 );
11 }
12 }
2 public class MyForm : Form
3 {
4 public void OnDataChanged(object obj, EventArgs args)
5 {
6 this.Invoke((MethodInvoker)delegate
7 {
8 label1.Text = "test";
9 }
10 );
11 }
12 }