Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to easily duplicate a Windows Form in Visual Studio?

How can I easily duplicate a C#/VB Form in Visual Studio? If I copy & paste in the Solution Explorer, it uses the same class internally and gets messed up. How do you do it?

like image 551
Robin Rodricks Avatar asked Aug 12 '09 20:08

Robin Rodricks


People also ask

How do you copy a whole form?

To copy a form within List view, hover to the right of the form, select More options > Copy. You'll see a duplicate form at the top of your list under All My Forms. It will have the same name as your original form.

How do I add a second form in Visual Studio?

Add a new form In Visual Studio, find the Project Explorer pane. Right-click on the project and choose Add > Form (Windows Forms). In the Name box, type a name for your form, such as MyNewForm. Visual Studio will provide a default and unique name that you may use.


1 Answers

I usually copy the files in windows explorer, open them up in Notepad/Wordpad and just change the one mention of the class name at the top. Include those files in your project, and you'll be good to go.

like image 185
JamesMLV Avatar answered Oct 06 '22 06:10

JamesMLV