显示其他应用程序的表单 [英] Show form from other appliation

查看:92
本文介绍了显示其他应用程序的表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好!我可以显示另一个应用程序(也是我自己制作的)中的表单吗?例如:我有application1,并且希望它将application2中的form1显示为对话框.

Hello! Can I show a form from another application(which is also made by me)? For example: I have application1 and I want it to show form1 from application2 as dialog.

推荐答案

最好的方法是将两者都提取到DLL中(创建一个新的类库项目),然后将该程序集作为参考添加到这两个应用程序中.
The best way is to extract it from both into a DLL (create a new class library project) then add the assembly to both applications as a reference.


使用其中的表单创建单独的DLL.用您知道的界面装饰表单.您可以在运行时加载DLL,并使用反射来检查实现该接口的类(窗体).通过反射创建表单的实例,并将其显示给用户.

干杯.
Create seperate DLLs with the forms in it. Decorate your forms with an interface that you know. You can load the DLLs at run time and use reflection to check for classes (forms) that implement the interface. Create an instance of the form through reflection and show it to the user.

Cheers.


这篇关于显示其他应用程序的表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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