[英]Webbrowser control throws exception when Form windowstate is minimized
I am using WebBrowser control on a WinForm. 我在WinForm上使用WebBrowser控件。 When my form is minimized the control throws an exception,
当我的表单最小化时,控件将引发异常,
An outgoing call cannot be made since the application is dispatching an input-synchronous call.
由于应用程序正在分派输入同步呼叫,因此无法进行拨出呼叫。 (Exception from HRESULT: 0x8001010D (RPC_E_CANTCALLOUT_ININPUTSYNCCALL))
(来自HRESULT的异常:0x8001010D(RPC_E_CANTCALLOUT_ININPUTSYNCCALL))
I have stated windowstate as, 我说windowstate为,
this.WindowState = FormWindowState.Minimized;
Does anyone aware of this issue ? 有人知道这个问题吗?
Thanks in advance, 提前致谢,
Vijay 维杰
Where you want to modify UI from other thread use invoke method 您想从其他线程修改UI的地方使用invoke方法
if (control.InvokeRequired)
{
control.Invoke( (MethodInvoker)( ()=> control.updatingfunction() ) ;
}
else
{
control.updatingfunction();
}
suppose you want to hide a panel (named panel1) from other thread. 假设您想从其他线程隐藏面板(名为panel1)。 Then your code will be
然后您的代码将是
if (panel1.InvokeRequired)
{
panel1.Invoke( (MethodInvoker)( ()=> panel1.Hide() )) ;
}
else
{
panel1.Hide();
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.