c#InvokeRequired

来源:互联网 发布:室内平面图制作软件 编辑:程序博客网 时间:2024/06/03 12:24
public void Function(){     if (this.InvokeRequired)     {         this.BeginInvoke(new Action(this.Function));         return;     }     // controller.DoSomething();         

}

其他线程想调用这个函数,这个时候InvokeRequired为1,要做的是new一个新的Function

0 0
原创粉丝点击