0

Hi. how to copy one form to anoter project?
i right click on project name and choose add existing item. i select one form from another project(all 3 files: .cs, .Designer.cs, .rsex) but it dosn't work.

3
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by ddanbe
0

Some people have other ways but I have had problems doing it any way except this way. Assume we have two projects: "Source Project" and "Destination Project". The source project contains the form we want to copy to the destination project.

In the destination project create a new form with the same name as the form we want to copy. After we create the new form add a "ContextMenu" to the form and save the solution. Adding the context menu forces the .resx file to be created and associated with the form.

Now close the "Destination Project" and open up windows explorer and delete the 3 files for the form: form.cs, form.designer.cs, and form.resx. Copy the file from the source project to the destination project.

Open up the 3 files we just copied inside of the "Destination Project" with notepad and change the namespace ____ line to reflect the namespace for the "Destination project"

It sounds complicated but it takes less than one minute once you are familiar with it.

0

Also had some issues with this sort of thing. Thanks for the tip Scott.
Renaming is also a tricky thing to do.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.