I have never been able to successfully add a Form
from an existing file to a new project.
I read on a blog that you add just the *.cs file and the depen
Here's an approach that doesn't involve closing the project and reopening it:
Maybe it is because of using visual studio 2012, but all these solutions didn't work. AtConway gave a hint to edit the csproj file. And that hint worked.
Drag and drop .cs files from filesystem to project tree in Solution Explorer (for example):
Don't forget about references if it is not Windows Forms project.
Although this is an old post, I was having the exact same problem as @MatthewRadford had described above. My workaround for this was to only add the .CS file (do not add the .resx file), and allow visual studio to automatically generate the .resx file right after adding the .cs file.
However, I found a permanent solution. If you began to experience this problem immediately after upgrading to a new version of visual studio, it is possible that during the upgrade, Active Reports was not registered properly. The solution is to deactivate your Active Reports (using GrapeCity License Manager), uninstall Active Reports, reinstall Active Reports from scratch, and reactivate your license. You should now be able to add the ReportName.cs and ReportName.resx, as well as the Designer.cs file, all at the same time, while having visual studio correctly handle their dependencies.
You can still use "Add Existing iTem"
"Add Existing iTem", select three files (.cs .resx .Designer.cs)
make sure "namespace Application" in your .cs file is the same as the project
now you can use auto-complete the Form you just added.
You need actually 2 files: - Form1.cs - Form1.Designer.cs
Copy - paste them to your new project (just make sure there is no such form with the same nameexisting in new project)