如何在Wpf中添加表单 [英] how to add form in Wpf

查看:101
本文介绍了如何在Wpf中添加表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi
请告诉我如何在wdf中添加Form in mdiparent

解决方案

WPF不支持MDI。最后,微软决定把这些垃圾丢弃。



这个想法是:谁需要MDI?为什么要折磨自己并吓跑你的用户?

帮自己一个大忙:根本不要使用MDI。没有它,您可以更轻松地实现设计,质量更好。 MDI甚至被微软高度劝阻,事实上,微软将其从WPF中删除并且很难支持它。更重要的是,如果您使用MDI,您将吓跑所有用户。请不要。



请参阅:

http://en.wikipedia.org/wiki/Multiple_document_interface#Disadvantages [ ^ ]。



另见我过去的答案:

在WPF中使用MDI窗口的问题 [ ^ ],

MDIContainer提供错误 [ ^ ]。



这不是MDI,但文章的作者只是cal领导它MDI。事实上,这不是MDI,而是更好的方法: WPF中的选项卡式MDI [ ^ ]。



现在,表格怎么样?不,WPF中没有表格,有窗口。表单存在于 System.Windows.Forms 库中,但您无法以任何简单的方式在WPF中使用它们。但是,您可以在WPF中使用一些 System.Windows.Forms 控件: https://msdn.microsoft.com/en-us/library/ms751761%28v=vs.110%29.aspx [ ^ ]。



我也不建议这样做。如果你使用WPF,更好地开发WPF中的所有东西,除非你有一些丑陋和令人信服的理由使用一些Forms组件。



-SA


一个类似的问题被问到http://www.codeproject.com/Questions/285867/How-to-Create-MDI-Parent-Window-in-WPF-通过解决方案

hi please tell me how to add Form in mdiparent in wpf

解决方案

WPF does not support MDI. Finally Microsoft decided to trash this garbage.

Here is the idea: who needs MDI, ever? Why torturing yourself and scaring off your users?
Do yourself a great favor: do not use MDI at all. You can do much easier to implement design without it, with much better quality. MDI is highly discouraged even by Microsoft, in fact, Microsoft dropped it out of WPF and will hardly support it. More importantly, you will scare off all your users if you use MDI. Just don't.

See:
http://en.wikipedia.org/wiki/Multiple_document_interface#Disadvantages[^].

See also my past answers:
Question on using MDI windows in WPF[^],
MDIContainer giving error[^].

This is not MDI but the author of the article just called it MDI. In fact, this is not MDI but something much better: Tabbed MDI in WPF[^].

Now, what about forms? No, there are no forms in WPF, there are "windows". Forms there are in the System.Windows.Forms library, but you cannot use them in WPF in any simple way. However, you can use some System.Windows.Forms controls in WPF: https://msdn.microsoft.com/en-us/library/ms751761%28v=vs.110%29.aspx[^].

I won't recommend going this way either. If you use WPF, better develop everything in WPF, unless you have some ugly and compelling reason to utilize some Forms components.

—SA


A similar question was asked http://www.codeproject.com/Questions/285867/How-to-Create-MDI-Parent-Window-in-WPF - go through the solutions.


这篇关于如何在Wpf中添加表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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