如何从另一个解决方案运行表单 [英] How to run a form from another solution

查看:72
本文介绍了如何从另一个解决方案运行表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个visual studio 2012的两个vb.net项目(Project1和Project2)。现在我已成功将两个解决方案导入到一个新项目中。 现在我想从project2彻底点击事件运行project1的表单....我怎么能运行.... 请帮助....

解决方案

请参阅我对该问题的评论。项目和解决方案都不是程序集,它们与运行时无关。实际上,要在另一个组件中使用一个组件,您需要引用要由使用组件使用的组件。更实际的是,不要在不同的解决方案中做任何可能相关的事情。创建一个解决方案并将所有相关项目放入其中。如果这样做,您可以通过添加引用窗口的项目选项卡引用程序集,假设您使用的是Visual Studio。



您实际上可以开发基于多种解决方案构建模式,但这是先进的,很少使用;你应该先学习基础知识。首先,您需要学习CLR和CLI的核心概念,汇编:

http://en.wikipedia.org/wiki/Assembly_%28CLI%29 [ ^ ],

http://msdn.microsoft.com/en-us/library/windows/desktop/aa367757%28v=vs.85%29.aspx [ ^ ],

http:// msdn。 microsoft.com/en-us/library/wkze6zky%28v=vs.110%29.aspx [ ^ ]。



你也应该了解不同建设阶段a源代码及其加载,JIT编译和运行的ssemblies。它应该可以帮助您理解项目和解决方案是开发和构建的工件,它们在运行时根本不存在。



-SA

I have an two vb.net projects (Project1 and Project2) of visual studio 2012. Now I have successfully import both solutions into a new project. Now I want to run project1's form from project2 thorough click event.... how can I run.... please help....

解决方案

Please see my comment to the question. Neither projects nor solutions are assemblies, they are irrelevant to runtime. Practically, to use one assembly in another one, you need to reference an assembly to be used by the using assembly. Even more practically, don't do anything potentially related in different solutions. Create one solution and put all related projects in it. If you do so, you can reference assemblies via the tab "Projects" of the "Add Reference" window, assuming you are using Visual Studio.

You can actually develop building schema based on multiple solutions, but this is way to advanced and quite rarely used; and you should first learn the basics. First of all, you need to learn the central concept of CLR and CLI, assembly:
http://en.wikipedia.org/wiki/Assembly_%28CLI%29[^],
http://msdn.microsoft.com/en-us/library/windows/desktop/aa367757%28v=vs.85%29.aspx[^],
http://msdn.microsoft.com/en-us/library/wkze6zky%28v=vs.110%29.aspx[^].

And you also should understand different phases of building of the assemblies from source code and its loading, JIT-compilation and running. It should help you to understand that projects and solutions are the artifact of development and the build, they simply don't exist during runtime.

—SA


这篇关于如何从另一个解决方案运行表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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