如何将mdi孩子带到其他形式的控件前面? [英] how to bring mdi child to front of other form's controls?

查看:123
本文介绍了如何将mdi孩子带到其他形式的控件前面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好..

我有很大的问题。我有一个主要形式和另一种形式,我想用作childmdi。我做到了,它的确有效。但问题是,当mdiChild出现时,它会落后于其他控件。我该如何解决?

这是我的代码:

Hi all..
I have big problem. I have a main form and another form which i want to use as a childmdi. i did that and it works. but the problem is that when the mdiChild appears, it goes behind of other controls. how can i fix that?
Here is my code:

Form2 MdiChild = new Form2();
MdiChild.MdiParent = this;
MdiChild.Show();

推荐答案

听起来你已经在MDI父级上绘制了控件。如果这是真的,你永远不应该这样做。控件总是放在MDI子项上,不包括状态栏,菜单栏等。
Sounds like you have drawn controls on the MDI parent. If that is true, you should never do that. Controls are always placed on MDI children excluding status bar, menu bar etc.


看,听一个好的友好建议:停止折磨自己并用MDI无意义追逐你的用户。几乎每个人都不鼓励它,微软努力将这个问题逐步解决。最后,MDI没有包含在WPF中,即使它仍然存在于 System.Windows.Forms 中,大概是为了与遗留代码的兼容性,但是即使是创建了这个概念的微软也非常气馁。



有很多强大的概念;最简单的是基于 TabControl 的选项卡式UI。



请参阅:

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

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

MDIContainer提供错误 [ ^ ],

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


-SA
Look, listen to a good friendly advice: stop torturing yourself and chasing out your users with that MDI nonsense. Nearly everyone discourages it, and Microsoft worked hard to phase this thing out. Finally, MDI was not included in WPF even though it remains in System.Windows.Forms, presumably for compatibility with legacy code, but highly discouraged even by Microsoft where this concept was created.

There are many robust conceptions; the simplest one is the tabbed UI based on TabControl.

Please see:
http://en.wikipedia.org/wiki/Multiple_document_interface#Disadvantages[^],
Question on using MDI windows in WPF[^],
MDIContainer giving error[^],
How to Create MDI Parent Window in WPF?[^].

Good luck,
—SA


尝试ZOrder方法。看看这是否有帮助, http://support.microsoft.com/kb/168850 [ ^ ]
Try ZOrder method. See if this helps, http://support.microsoft.com/kb/168850[^]


这篇关于如何将mdi孩子带到其他形式的控件前面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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