引发类型为“System.Windows.Forms.AxHost+InvalidActiveXStateException”的异常 解决办法

出现题目的异常,多是引用第三方控件引起的。

在NEW时,需要初始化该对象。

             AxESACTIVEXLib.AxESActiveX ax = new AxESACTIVEXLib.AxESActiveX();

            ((System.ComponentModel.ISupportInitialize)(this.ax)).BeginInit();
            this.Controls.Add(ax);
            ((System.ComponentModel.ISupportInitialize)(this.ax)).EndInit();

这样就OK了。


转载:http://blog.csdn.net/fch2004/archive/2008/08/02/2759572.aspx

fffffffffffffffff
test red font.
原文地址:https://www.cnblogs.com/wgscd/p/14510531.html