C# 在创建窗口句柄之前,不能在控件上调用 Invoke 或 BeginInvoke

http://www.cnblogs.com/fish124423/archive/2012/10/16/2726543.html

在Invoke(....)之前加上1 this.components==null 2 this.IsDisposed 3 IsHandleCreated 来return 不执行invoke就可以,当然只是我针对自己遇到的解决的,可能并不适合其他的,但是总不会脱离其中

if (IsDisposed ||!this.Parent.IsHandleCreated) return;

猜你喜欢

转载自www.cnblogs.com/LuoEast/p/10161686.html