System.InvalidOperationException:在创建窗口句柄之前,无法在控件上调用Invoke或BeginInvoke

时间:2014-09-02 16:30:13

标签: vb.net

每当我们关闭我们的应用程序时,都会出现一个未处理的异常,但它没有详细说明它的根本原因:

{System.InvalidOperationException: Invoke or BeginInvoke cannot be called on a control until the window handle has been created.
at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)
at System.Windows.Forms.Control.BeginInvoke(Delegate method, Object[] args)
at System.Windows.Forms.WindowsFormsSynchronizationContext.Post(SendOrPostCallback d, Object state)
at System.Windows.Forms.AxHost.ConnectionPointCookie.Finalize()}

我在代码中没有看到我们调用BeginInvoke的地方。

我们正在调用Invoke,但仅限于InvokeRequired = True。

有没有人见过这个?

0 个答案:

没有答案