[英]Panel in MDI Parent overlapped by child when maximized
I'm writing a windows application using VS2010 and C# 4.0. 我正在使用VS2010和C#4.0编写Windows应用程序。 I have a MDI Parent form, and I need to have a "settings panel" at the bottom of it.
我有一个MDI父窗体,并且在它的底部需要有一个“设置面板”。 I used a borderless form for this purpose.
为此,我使用了无边界表格。 But now while the application is running, when I maximize a child form it overlaps the settings panel.
但是现在,当应用程序运行时,当我最大化一个子窗体时,它与设置面板重叠。 How can I avoid that?
我该如何避免呢? My settings panel should always be visible and never overlapped by anything else.
我的设置面板应始终可见,并且不得与其他任何物体重叠。
Do not use a Form
for this. 请勿为此使用
Form
。 You should be using a simple Panel
. 您应该使用一个简单的
Panel
。 Follow these simple steps: 请遵循以下简单步骤:
IsMdiContainer
to false
. IsMdiContainer
为false
。 Panel
to your main Form
and dock it to the bottom (or whatever option you prefer, left, right, etc.). Panel
添加到您的主Form
并将其停靠在底部(或您喜欢的任何选项,向左,向右等)。 This pannel will be your settings panel. IsMdiContainer
back to true
. IsMdiContainer
回true
。 Steps 3 and 4 can be done in any order. 步骤3和4可以按任何顺序进行。
The reason to first set the IsMdiContainer
to false
is to make sure you can dock your Panel
inside the client space of the Form
and not to inside client space of the MdiContainer
control (which is automatically added by the designer when you set IsMdiContainer
to true
with it's docking set to Fill
). 首先将
IsMdiContainer
设置为false
的原因是确保可以将Panel
停靠在Form
的客户端空间内,而不是停靠在MdiContainer
控件的客户端空间内(当您将IsMdiContainer
设置为true
时,设计器会自动添加它)它的对接设置为Fill
)。 If you were to dock it inside the MdiContainer
the Panel
would be hidden by any MdiChild you were to open. 如果要将其停靠在
MdiContainer
则Panel
将被您要打开的任何MdiChild隐藏。 Note that you can not interact directly with the MdiContainer
control in the designer. 请注意,您不能直接与设计器中的
MdiContainer
控件进行交互。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.