无法将类型为“System.Windows.Forms.SplitContainer”的对象强制转换为类型“System.ComponentModel.ISupportInitialize”

Posted swtool

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了无法将类型为“System.Windows.Forms.SplitContainer”的对象强制转换为类型“System.ComponentModel.ISupportInitialize”相关的知识,希望对你有一定的参考价值。

解决办法:

在设计器代码中把4.0自动加上去的代码注释掉就行了。

 //((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit();
  //((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();

按不同的版本进行条件编译

#if V2007
#else
((System.ComponentModel.ISupportInitialize)(this.scMain)).EndInit();
#endif

以上是关于无法将类型为“System.Windows.Forms.SplitContainer”的对象强制转换为类型“System.ComponentModel.ISupportInitialize”的主要内容,如果未能解决你的问题,请参考以下文章

SQL Server Management Studio 无法将类型为“System.__ComObject

C# 无法将类型为“System.Byte[]”的对象强制转换为类型“System.Data.DataTable

无法将类型“()”的值转换为预期的参数类型“字符串”

无法将 [Struct] 类型的值快速转换为 [string] 类型

无法将类型为“Microsoft.Office.Interop.Word.ApplicationClass”的 COM 对象强制转换为接口类型“Micro

Swift“无法将''类型的值转换为'String'类型