我们如何在另一个项目的项目中添加表单。 [英] How we can add a form in project from another project.

查看:129
本文介绍了我们如何在另一个项目的项目中添加表单。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个项目。

第一个项目包含3个表格。表单名称ExpensForm,SaleForm,ProfitForm

现在我想在我的第二个项目中添加ExpensForm。

在Visual Studio 2017上使用C#

我该怎么做呢请告诉我detil。

我在Parograming中更大。

先谢谢。



我尝试了什么:



我不知道我怎么能这样做

I Have two Projects .
First project contain 3 forms. Form Names ExpensForm,SaleForm,ProfitForm
Now i want to add the ExpensForm in my Second Project.
using C# on Visual studio 2017
How can i do this Please Tell me in detil.
Im Bigner in Parograming .
Thanks in Advance.

What I have tried:

I have no idea How can i do this

推荐答案

将第一个项目的引用添加到第二个项目中:右键单击解决方案资源管理器窗格中的项目名称,然后选择添加...引用以显示引用对话框。然后将EXE或项目添加到引用。

然后使用行添加到.CS文件中以包含项目命名空间。

您现在可以将第一个项目中的表单视为第二个项目的一部分。
Add a reference to the first project to your second: right click the project name in the Solution Explorer pane, and select "Add...Reference" to bring up teh References dialog. Then add the EXE or project to the references.
Then add a using line to your .CS file to include the project namespace.
You can now treat forms from the first project as if they were part of your second.


如果您想使用独立的(=更改一个表单不会更改其他形式)表格副本:



选择Visual Studio菜单项目 - >添加现有项目...

然后在文件对话框中选择(浏览)要添加到项目的Form.cs(Form =表单名称)和表单(包含所有相关文件) )(复制并)添加到您的项目中。
If you want to use an independent (= change one form does not change the other form) copy of the form:

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.


这篇关于我们如何在另一个项目的项目中添加表单。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆