Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add a Form that is in my Project to another Project

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.

like image 338
Tavousi Avatar asked Feb 05 '11 04:02

Tavousi


People also ask

How do I add a form to another project?

Right-click on the project and choose Add > Form (Windows Forms). In the Name box, type a name for your form, such as MyNewForm. Visual Studio will provide a default and unique name that you may use.

How do I add a form from one project to another in Visual Studio?

Select Visual Studio menu Project -> Add Existing Item... Then select (browse) in the file dialog the Form. cs (Form = name of the form) you want to add to the project and the form (with all associated files) is (copied and) added to your project.

How do I copy a form from one project to another in VB net?

Right click on your project file in Solution Explorer and choose Add -> Existing Item. Show activity on this post. You need to copy all the files. You should even be able to open two instances of Visual Studio and drag and drop the form from one to the other.


1 Answers

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)

like image 85
Shekhar_Pro Avatar answered Nov 16 '22 01:11

Shekhar_Pro