I have a Project in which there is a form that has several objects (controls) in itself. I want to add this form to another Project in another Solution. How to I can do this. Thanks.
Asked
Active
Viewed 2.7k times
8
-
1The question isn't clear... did the other form is in the same projet ? or you just want to show up another form at runtime ? can you specify – Jean-Christophe Fortin Feb 05 '11 at 04:42
-
+1 @Jean i did answered but still not clear if this is what OP wants. – Shekhar_Pro Feb 05 '11 at 04:57
-
i have edited the question... as it looks like this is what he wanted. – Shekhar_Pro Feb 05 '11 at 05:28
-
@Shekhar_Pro It seems you got it right ! but i'm not sur about copying the form in his project. I prefer add the other project in my solution to avoid duplicate object. – Jean-Christophe Fortin Feb 05 '11 at 05:31
-
@Jean i have mentioned similar case in 2nd Notes of my answer. – Shekhar_Pro Feb 05 '11 at 05:37
-
Possible duplicate of [How do you add an existing form to a new project?](https://stackoverflow.com/questions/10316650/how-do-you-add-an-existing-form-to-a-new-project) – StayOnTarget Nov 29 '18 at 16:38
1 Answers
24
You mean you have an Form in your Project and you want to add it to another Project in some other Solution. If this is the case then.
Follow the steps:
- Right Click on Project in Solution Explorer
- Select Add -> Existing Item ,
- In the Add Existing Item Dialog Box browse to the "Form.cs" you want to Add.
It will be copied to your local Solution Project Folder with every thing in it (including designer.cs and resource files).
Notes:
Just after adding the Form's ".cs" file you may only see the Form.cs not the Design view. Just open the File in code editor and the Visual Studio will automatically draw the Form in Designer for Design Support.
This operation will add the Files as a Copy. They will be independent to the changes to the Original Form. If you want to have changes then add it as a Link. (Select Add as Link in the Add Existing Item Dialog Box)

Shekhar_Pro
- 18,056
- 9
- 55
- 79
-
1may need to adjust the namespace if the namespace is different in the other project – Sam Jan 29 '12 at 03:31