在MDIParent 中使跨线程操作无效
可能重复:
跨线程操作无效
我试图从另一个线程关闭表单的基础。 我收到以下错误。
System.InvalidOperationException:跨线程操作无效:从创建它的线程以外的线程访问控制’MDIParent’。
对于以下行:
MDIParent.MDIParentRef.BaseClose();
您需要在UI线程上执行操作:
上述就是C#学习教程:在MDIParent 中使跨线程操作无效分享的全部内容,如果对大家有所用处且需要了解更多关于C#学习教程,希望大家多多关注—计算机技术网(www.ctvol.com)!
if (InvokeRequired) Invoke(new Action(MDIParent.MDIParentRef.BaseClose)); else MDIParent.MDIParentRef.BaseClose();
本文来自网络收集,不代表计算机技术网立场,如涉及侵权请联系管理员删除。
ctvol管理联系方式QQ:251552304
本文章地址:https://www.ctvol.com/cdevelopment/1021825.html