将项目添加到解决方案资源管理器,但有错误 [英] Add project to Solution Explorer but have error

查看:103
本文介绍了将项目添加到解决方案资源管理器,但有错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我添加了现有项目;
但我不能在主项目中使用表格

您能帮我吗

Hi


I Was add existing project ;
but I cant Use the form in main project

Can you help me

推荐答案

引用主项目中的新项目,然后使用主项目中的完整命名空间在新项目中调用表单.

Reference the new project in the main project then call the form in the new project using the full namespace from your main project.

newproject.newform f = new newproject.newform();// code in the main project


在解决方案资源管理器"窗格的引用"部分中添加对已添加项目的引用旧项目的说明:
右键单击引用"部分,然后选择添加新引用".
出现对话框时(可能需要一段时间),选择项目"选项卡
突出显示添加的项目,然后选择确定.
在您的旧项目代码中,键入添加项目中表单的名称.一条小红线将出现在末尾.
将鼠标悬停在该行上,打开出现的下拉列表,然后选择添加"using"语句.
Add a reference to the added project in the References section of the Solution Explorer pane of the old project:
Right click the References secrtion and select "Add new reference".
When the dialog comes up (and it can take a while) select the "Projects" tab
Highlight the added project and select OK.
In your old project code, type the name of the form from the added project. A small red line will appear at the end.
Hover the mouse over the line, open the dropdown when it appears, and select to add the "using" statement.


这篇关于将项目添加到解决方案资源管理器,但有错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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