通过组合多个项目创建多个表单

发布于 2024-09-30 14:34:28 字数 176 浏览 1 评论 0原文

假设我有一个包含两个按钮的项目。每个按钮都会生成一个自定义表单。我手动编写了这两种表格。但我想知道,有没有一种方法可以通过在不同项目中使用工具箱来制作这些表单,并将它们组合到一个解决方案中。我的意思是,当我按下按钮时我想调用另一个项目。

最后,如果存在这样的解决方案,那么制作这样的程序是正确的方法,还是手动创建表单更好?

Assume that I have a project that contains two buttons on it. Each buttons generate a custom form. I wrote both forms manually. But I wonder, is there a way that I can make these forms by using toolbox in different projects and combine them in one solution. I mean, when I press a button I want to call another project.

And finally if such a solution exists, is it proper way to make programs like this , or is it better to create forms manually ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

愁杀 2024-10-07 14:34:28

如果它是公共的,您可以从另一个项目(如果我们谈论的是 VS 项目)调用表单。您需要将对“放置”此表单的项目的引用添加到进行调用的项目中。

当然,您可以手动创建表单,但您也可以创建新的窗口表单并通过设计器向其添加控件。

还有关于正确的方法。如果您需要从不同的项目调用相同的表单,那么,是的,保留在第三个项目中就可以了。

You can call a form from another project (if we are talking about VS project) if it is public. You need to add reference to the project where this form is "placed" to the project where the call is made.

Of course, you can create forms manually, but you can as well create new windows form and add controls to it via designer.

And about the proper way. If you need the same form to be called from different projects, then, yes, keeping in in some third project is alright.

温暖的光 2024-10-07 14:34:28

是的,您可以调用表单,即使它们位于不同的项目中。但是您需要引用该项目并定义正确的 using 语句。

Yes you can invoke the forms even if they are in different projects. But you need to have references to that projects and to have defined a proper using statements.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文