Add a Form that is in my Project to another Project

26,249

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)

Share:
26,249
Tavousi
Author by

Tavousi

Updated on April 02, 2020

Comments

  • Tavousi
    Tavousi about 4 years

    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.

  • Sam
    Sam over 12 years
    may need to adjust the namespace if the namespace is different in the other project