如果不在控件主类中改变控件值,会出现运行时错误,提示不能在不同线程中使用控件的错误。
处理方法是:
</pre><p><pre name="code" class="csharp">Button b;
b.Invoke(
new Action(
delegate {
b.text = "test";
}
)
)
如果不在控件主类中改变控件值,会出现运行时错误,提示不能在不同线程中使用控件的错误。
处理方法是:
</pre><p><pre name="code" class="csharp">Button b;
b.Invoke(
new Action(
delegate {
b.text = "test";
}
)
)