C#程序在VS2010中复制窗体

1、一个窗体有三个文件,全部拷贝到新的项目文件目录中

2、在新项目中添加现有项,然后把这个窗体相关的三个文件都添加到新的项目中

4、打开窗体代码,修改public partial class Old : Form 中的Old为新窗体类名New.

重要:窗体初始化模块中的Old也相应的修改为New

public Old(){

InitializeComponent();

};

5、异常重要:

打开窗体设计器代码New Designer.cs,修改partial class Old :Form中的Old为新类名New。

尤其重要的是:

修改


partial void InitialzeComponent()中System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Old))
中的Old为New。

猜你喜欢

转载自blog.csdn.net/tmjianjun/article/details/100007102