Copying winforms between projects in Visual Studio

后端 未结 18 2165
天涯浪人
天涯浪人 2020-12-13 18:16

What is the best way to copy or cut/past a form from one Project to another Project within a Solution in Visual Studio?

Whenever I try it, using the solution explore

18条回答
  •  误落风尘
    2020-12-13 18:43

    Make sure that you copy not only the Form.cs, but also the Form.designer.cs and Form.resx files.

    But I need to ask why you would want to maintain a copy of the same form in multiple projects within the same solution. Sounds as if you might want to generalize the code in it, put it in a class library and re-use it in the places where it is applicable.

提交回复
热议问题