-
添加三菱dll引用
-
WPF实现
添加WindowsFormsIntegration 引用
初始化代码
//解决因为第三方控件报错,将实例化的对象添加到控件合集中
System.Windows.Controls.Grid CTSGrid = new System.Windows.Controls.Grid();
System.Windows.Forms.Integration.WindowsFormsHost host = null;
host = new System.Windows.Forms.Integration.WindowsFormsHost();
host.Child = actUtlTypeLib.AxActUtlType;
((ISupportInitialize)actUtlTypeLib.AxActUtlType).BeginInit();
CTSGrid.Children.Add(host);
((ISupportInitialize)actUtlTypeLib.AxActUtlType).EndInit();
3. WINFROM实现
初始化代码
//解决因为第三方控件报错,将实例化的对象添加到控件合集中
((ISupportInitialize)(this.axActUtlType1)).BeginInit();
this.Controls.Add(axActUtlType1);
((ISupportInitialize)(this.axActUtlType1)).EndInit();
参考文献
https://www.cnblogs.com/ldl-david/p/5311848.html