MDI Form& MDI儿童 [英] MDI Form & MDI Child

查看:67
本文介绍了MDI Form& MDI儿童的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好。

如果用户按下退出命令按钮,我怎么能让子MDI表格不失焦点?我已经尝试过表单show modal,但是我不能在MDI子表单中使用它

现在当用户点击MDI子表单的边缘时,表单丢失焦点和主MDI它出现

有任何建议如何避免这种情况?

Hello everybody
How can i make child MDI form to not lost focus until the user push the exit command button? i have tried form show modal, but i can't use it in MDI Child Form
Now when the user clicks at the margins of the MDI Child form, the form lost the focus and the main MDI it shows up
Any suggestion how to avoid this?

推荐答案

正式,表格 ,因为任何 Control 都有焦点,但此属性对于此类 Control 而言并不实际。实际属性是激活。 MDI的怪异之处在于:同时激活其中一个子表单的父表单。仍然,焦点的概念适用于每个表单上的一个控件,当其表单被激活时会获得焦点。我不明白为什么它会导致问题。希望这些考虑可以帮助你把它做对。至于MDI本身...



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

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

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

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



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

为什么WPF本身不支持MDI表单? [ ^ ],

如何在WPF中创建MDI父窗口? [ Solution 2 ],

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

MDIContainer给出错误 [ ^ ],

如何设置最大化的子表单,最小化最后一个子表单 [ ^ ]。



-SA
Formally, Form, as any Control has a focus, but this property is not actual for this type of Control. The actual property is the activation. The MDI weirdness is: the parent one one of the child forms are activated at the same time. Still, the notion of focus is applicable to one of the control on each form, which gets focus when its form is activated. I don't see why it can cause a problem. Hopefully, these consideration can help you to put it right. As to the MDI itself…

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. 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:
Why MDI form is not supported natively in WPF ?[^],
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[^].

—SA


这篇关于MDI Form& MDI儿童的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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