MDI表格和孩子 [英] MDI Forms and Children

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

问题描述

你好,

假设您有一个带有一个或多个工具栏的主窗体,并且要添加一个MDI子项,如下所示(在MDI父项中)

frmChild frm =新的frmChild();
frm.TopLevel = false;
frm.Parent = this;
frm.Show();


在这种情况下,子窗体出现在我的工具栏下方.

Hi there

Say you have a main form with one or more toolstrips and you are adding an MDI child as follows (in MDI parent)

frmChild frm = new frmChild();
frm.TopLevel = false;
frm.Parent = this;
frm.Show();


In this case the child form appears underneath my toolstrip.

Is there a simple way to prevent this?

推荐答案

您应该设置MdiParent,而不是Parent.

您想要更好的建议吗?不要折磨自己,不要吓scar用户:永远不要使用MDI.
参见:
http://en.wikipedia.org/wiki/Multiple_document_interface#Disadvantages [在WPF中使用MDI窗口的问题 [ ^ ],
提供错误的MDIContainer [
You should set MdiParent, not Parent.

Do you want a better advice? Don''t torture yourself and never scare off your users: never use MDI.
See:
http://en.wikipedia.org/wiki/Multiple_document_interface#Disadvantages[^],
Question on using MDI windows in WPF[^],
MDIContainer giving error[^].

—SA


为什么将TopLevel设置为false?那可能是你的问题.

编辑===============

如果有投票的人回答1,那么至少要当个男人并说出原因.如果我的回答是错误的,我将其删除,但您必须先向我证明它是错误的.
Why are you setting TopLevel to false? That might be your problem.

EDIT ===============

If whoever is voting answers a 1 is going to do that, at least be a man and say why. If my answer is wrong, I''ll delete it, but you have to prove to me it''s wrong first.


顶层为假,使其隐藏在其他形式之后.因此,删除该语句.肯定可以.
Top Level to false making it hidden behind other forms. So, remove that statement. It will definitely work.


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

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