【发布时间】:2013-05-21 10:51:06
【问题描述】:
我知道从另一个线程更新标签的最简单方法是:
void DoSomething()
{
if (InvokeRequired)
{
Invoke(new MethodInvoker(DoSomething));
} else
{
// Do Something
}
}
我的问题是,是否可以代替需要从另一个线程更新 GUI 的 if 更改回主线程并从那里更新 GUI?
【问题讨论】:
-
请更好地解释您的问题。你想完成什么?
-
it possible to change back to the main thread and update the GUI from there这正是Invoke所做的。