Add a Form that is in my Project to another Project

折月煮酒 提交于 2019-12-23 07:46:12

问题


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.


回答1:


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)



来源:https://stackoverflow.com/questions/4905179/add-a-form-that-is-in-my-project-to-another-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!