How do I copy a form and rename it in VS2015

I have a complicated form with a lot of controls on it. I would like to copy that form and rename it so that I can re-code the code behind the form. I am learning VB.NET and I would like to preserve a working copy of the form while I experiment with the same form using different code approaches.

I am not looking to create a new class just for this form. I am do this simply as a learning process for variations of coding within a form.
Lenny GrayAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
I do it like this:

1. Highlight the form in the Solution Explorer and click Ctl-C and Ctl-V. This will make a copy of the form named <formname>-COPY
2. In Windows Explorer, I then open the ".designer.vb" file with a standard text editor (like Notepad) and change the name of the Class
3. Again in Windows Explorer, I open the ".vb" file and change the name of the Class.

The name of the Class in 2 and 3 must match, of course.

When you return to VS, you'll be notified that the files have been changed externally, and asks if you'd like to reload them. Accept that, and you should be good to go.

Here's a picture that shows the file loaded in an editor, with a box around the name. The name of the "original" class in this case was "rTeamScores". I changed it to "rTeamScores2":
Class Name
And in the Designer file:
ClassName Change Designer file

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Lenny GrayAuthor Commented:
Thanks for your quick response!  When I had done the copy on my own, I never knew that I had to do items #2 and #3, as you had pointed out.

I appreciate your help!!!


It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.