子表单是否在主表单面板中加载而没有任何变化? [英] sub form is load in panel of main form without any changes?

查看:72
本文介绍了子表单是否在主表单面板中加载而没有任何变化?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好。我是Windows应用程序的新手...在我的项目中,我有超过12种表单...我不知道MDI ..然后我会开发一个表单导航按钮...这个项目有2种类型的用户

管理员和经理。在这里我的问题是,当我导航到另一个...它使眨眼和推卸显示新的形式...我怎么能处理这个......?

是否有可能加载一个其他的表单进入我的主表单面板...

Hi. i am new to Windows application... in my project i have more than 12 forms... i don''t know about MDI.. then i would develop a form navigation button... this project is have 2 type of user
Admin , and Manager. here my problem is when i navigate one to another... it make blink and shirk to show new form... how can i handle this... ?
Is it possible to load a all other forms into my main form panel...

推荐答案

您可以在某些 Panel 中显示某个表单,但是这样太糟糕了。您需要将表单作为面板的子项。如果你只是这样做,它将抛出异常;在图书馆中,有充分的理由是故意将亲子关系故意解散。即使您可以通过将 TopLevel 指定为false来解决问题,但是......不要这样做。它会违反预期的UI风格,只会导致你不必处理的问题。



也不要进入MDI。之后,所有需要MDI的人,永远?为什么要折磨自己并吓跑你的用户?

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

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

如何在WPF中创建MDI父窗口? [ ^ ]。



我可以解释做什么。请看我过去的答案:

如何在WPF中创建MDI父窗口? [解决方案2 ],

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

麦当劳给出错误 [ ^ ],

如何设置子窗体最大化,最后一个子窗体最小化 [ ^ ]。



最后,不要创造这么多形式。我已经建议在上面提到的过去的答案中做些什么。你自己几乎找到了正确的想法。尝试设计只有一个主要形式的UI(一些次要形式的模态形式不计算)。您之前拥有表格的内容应转换为面板或标签页。您的主窗体应该隐藏大部分面板(并且标签页将始终隐藏),为您提供多个子窗体的效果(但当然,它们不是真正的形式,而是一些容器控件)。



-SA
You can show some form in some Panel, but this is too bad. You would need to make a form a child of the panel. If you simply do it, it will throw an exception; in the library, the parent-child relationship is made defunct intentionally, for a good reason. Even though you can work around by assigning TopLevel to false, but… don''t do it. It would violate intended UI style and just cause you the problem you don''t have to deal with.

Don''t get into MDI either. After, all, 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. Please see:
http://en.wikipedia.org/wiki/Multiple_document_interface#Disadvantages[^],
How to Create MDI Parent Window in WPF?[^].

I can explain what to do instead. Please see my past answers:
How to Create MDI Parent Window in WPF? [Solution 2],
Question on using MDI windows in WPF[^],
MDIContainer giving error[^],
How to set child forms maximized, last childform minimized[^].

And finally, don''t create so many forms. I already suggested what to do in my past answers referenced above. You almost came the the right idea yourself. Try to design the UI with only one main form (some minor number of modal form do not count). What you has a forms before should be converted to the panels or tab pages. Your main form should hide most of the panels (and tab pages will always be hidden), giving you the effect of multiple "sub-forms" (but of course, they are not really forms but some container controls).

—SA


这篇关于子表单是否在主表单面板中加载而没有任何变化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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