在同一解决方案中从其他项目打开一个项目中的表单 [英] Open a form in one project from other project in same solution

查看:65
本文介绍了在同一解决方案中从其他项目打开一个项目中的表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的,



我的vb.net解决方案中有2个项目。

现在我想在第二个版本中运行一个表单项目来自第一个项目如何做到这一点。



请帮助我

Dear all,

I have 2 projects in my vb.net solution.
now i want to run a form in second project from first project how to do this.

Please help me

推荐答案

添加对Project2的引用在Project1中。

添加适当的Imports语句。

以与现有项目相同的方式打开表单!



警告:不要尝试在P2中添加对P1的引用,在P1中添加对P2的引用 - 这会创建循环依赖,VS将不允许它,因为它将无法再编译! :笑:

如果你需要那种相互依赖性,添加第三个项目,它们都引用而不是相互引用。
Add a Reference to Project2 in Project1.
Add the appropriate Imports statement(s).
Open the form in the same way you would from your existing project!

Warning: Do not attempt to add a Reference to P1 in P2, and a reference to P2 in P1 - this creates a circular dependency and VS will not allow it as it would no longer be possible to compile! :laugh:
If you need that kind of interdependence, add a third project which both reference instead of referencing each other at all.


这篇关于在同一解决方案中从其他项目打开一个项目中的表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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