プロジェクトで独自のカスタム コンボ ボックス コード .cs クラス ファイルを作成し、それをフォーム コントロール (デザイナー ファイル) で使用した Windows フォームがあります。
これは、作成された既存のプロジェクトでは問題なく機能します (つまり、デザイナー ファイルのコードを手動で変更して、カスタム コントロールに適応させました)。
問題: 同じフォームとコントロールを別のプロジェクト (ソリューション) で作成する必要があります...
mycombo.class ファイルと残りのフォームを他のプロジェクト ソリューションにコピーすると、以下のエラーが発生します (フォーム デザイナー ファイルを開こうとすると)...
"The designer cannot process unknown name 'comboBox_SourceType' at line 46. The code within the method 'InitializeComponent' is generated by the designer and should not be manually modified. Please remove any changes and try opening the designer again"
Could not find type 'AP_CoSD_Tool.MyCombobox'. Please make sure that the assembly that contains this type is referenced. If this type is a part of your development project, make sure that the project has been successfully built using settings for your current platform or Any CPU.
ファイルを実行するとプロジェクトは正常に動作しますが、desiner.cs ファイルを開くと、特にコピーされたすべてのフォームの designer.cs ファイルのカスタム コンボボックス コントロールでエラーが発生します。
この問題の解決策はありますか? これを解決するためにさらに情報が必要な場合はお知らせください....
コードに移動をクリックすると、それぞれのデザイナー ファイルが開き、次の行に移動します。
this.tableLayoutPanel1.Controls.Add(this.comboBox_SourceType, 1, 0);
this.tableLayoutPanel1.Controls.Add(this.comboBox_commodity, 1, 3);
this.tableLayoutPanel1.Controls.Add(this.comboBox_BusinessType, 1, 1);
this.tableLayoutPanel1.Controls.Add(this.comboBox_group, 1, 2);
ここで、comboBox_sourcetype およびその他のコンボボックスは、カスタム作成されたコントロールです。