winFrom控件在不同线程调用

来源:互联网 发布:2016年淘宝注册用户 编辑:程序博客网 时间:2024/05/17 02:06

如果不在控件主类中改变控件值,会出现运行时错误,提示不能在不同线程中使用控件的错误。

处理方法是:

</pre><p><pre name="code" class="csharp">Button b;
b.Invoke(new Action(delegate {b.text  = "test";}))


0 0
原创粉丝点击