How to Copy Windows Form with Designer Link

JimUnderwood

New member
Joined
Sep 10, 2005
Messages
3
Programming Experience
10+
How to Copy Windows Form with Designer Link [RESOLVED]

How do I create a copy of a Windows form in VS.NET 2003 in the same project so that both the original and copy will still come up in the Designer and all of the custom code is intact?

I have tried copy/paste in the Solution Explorer, but the copy loses the link to the Designer. The code files are copied fine.

I have tried "Save Form AS" when I have the original form open in the designer. The copy works fine, but the original form loses the link to the Designer.

This has got to be something simple -- I just can't find it. Sorry for the rank amateur question.

TIA.

>JMU<
 
Last edited:
close the VS editor and go to the solution's folder in windows highlight the *.vb and the *.resx using the right mouse button drag and drop them into the same folder now change the name of both files so something more rememberable

now start VS and open the solution and in the project file in the solution explorer right click is and click add then select add existing item and add the form you just renamed

and tada both forms are there complete with the designer links and everything
 
JuggaloBrotha,

Thanks for the suggestion. This works, but you put me on the track to a simpler solution.

I found out the reason the Designer link is removed is because the class name of the copied form is the same as the original.

Here's my simple solution:

1. In the Solution Explorer, right-click on the form .vb file and select COPY
2. Click on the Project, right-click on select PASTE
3. Click on the "COPY OF .." file, right-click and select RENAME
4. Type your new form name
5. Double-click the new form in the Solution Exp to open up the code window
6. Change the CLASS name at the top
7. Save and close and now the icon shows the Designer link.
8. When you double-click on the form it will now open in the Designer.

Looks long and complicated when I lay out the steps, but one you do it, it goes fast, and you don't have to close VS.net or your solution/project.

Thanks.

>JMU<
 
lol yea, i knew about doing that (the solution explorer does what you can do in windows)

but i'm used to doing the way i suggested because i've got to copy form's from one solution to another


but yes, your way doesnt involve closing VS
 
Back
Top