【发布时间】:2009-03-17 15:57:35
【问题描述】:
我有监控设备状态的线程(使用 i/o)。这会将事件触发到有关连接状态(已连接、已断开、故障)的几个 UI(表单/对话框..)部分。基于此状态,表单和对话框被销毁、创建、启用和禁用。
我的问题:
I getting Cross-Thread exception because the thread doing the operations like Dispose the from, create the from .... . I using smart client, forms and dialogs are part of the WorkItemController and i just terminating that.
我不想让你使用 Invoke 或 BeginInvoke 。我希望这个线程继续只监视状态。所以这个线程必须将其控制权交给主线程,主线程将关闭表单或创建表单。
只是我想如何将控件从一个线程转移到另一个线程。有什么办法吗?
【问题讨论】:
标签: c# multithreading