请教怎样从别的代码中导入一个窗体?
WL798 2008-11-20 09:49:20 我把Form2.cs,Form2.Designer.cs,Form2.resx三个文件拷贝至WindowsApplication1目录下,添加现有项后解决方案资源管理器中可以显示,然后把Program.cs中改成
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
//Application.Run(new Form1());
Application.Run(new Form2());
但最后一行运行时显示错误:
错误 2 找不到类型或命名空间名称“fangong”(是否缺少 using 指令或程序集引用?)
错误 3 与“System.Windows.Forms.Application.Run(System.Windows.Forms.Form)”最匹配
错误 4 参数“1”: 无法从Form2”转换为“System.Windows.Forms.Form”
这个错误该怎么解决呢?