Panel.Dock填补忽视其他Panel.Dock设置 [英] Panel.Dock Fill ignoring other Panel.Dock setting

查看:313
本文介绍了Panel.Dock填补忽视其他Panel.Dock设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果您创建一个面板窗体上,并将其设置为停靠=顶部和下降的另一个面板,将其码头=填充,它可能会填满整个形式,忽略了第一盘。更改Tab顺序不做任何事情。

解决方案

对接布局取决于兄弟控制的为了上。停靠仅控制采取的 $ P $布局pvious 的停靠兄弟姐妹进去。因此,与码头=填充的控制应该是最后一次在同级次序,如果你想让它采取其他停靠的控制考虑,而不是仅仅被他们重叠。

这会引起混乱,因为同级顺序不一定是相同的视觉顺序和同级次序并不总是从设计视图显而易见。

文档大纲窗口(查看 - >其他窗口 - >文件提纲)给出了一个有用的树视图控件上的层次结构和秩序,并允许您更改控件的同级次序<。 / P>

您也可以直接在设计上下文菜单中更改同级次序 - >置于顶层/发送到后,该移动控制成为第一个或最后一个兄弟姐妹。这些菜单标签可能有些混乱,因为实际的效果取决于布局模型

使用固定的定位控制,二维位置是独立于同级次序的,但是当控制是重叠的,控制最早的顺序将是上头,在后来的为了隐瞒姐弟的一部分。在此背景下移到前面/发送到备份是有道理的。

在流量 - 或表布局面板,创建顺序决定了控件的视觉秩序。没有重叠的控制。因此带来正面/发送到备份的真正含义做出第一或最后的控制命令。

通过停靠布局,带来前/置后可能会更加混乱,因为它决定了责令对接的计算方法,因此带来阵线在填充停靠控件将放置在中控中等的母公司,全取边停靠控件进去。

If you create a panel on a form and set it to Dock=Top and drop another panel and set its Dock=Fill, it may fill the entire form, ignoring the first panel. Changing the tab order does nothing.

解决方案

Docking layout depends on the order of sibling controls. A docked controls only take the layout of previous docked siblings into account. Hence the control with Dock=Fill should be last in the sibling order, if you want it to take the other docked controls into account, and not just be overlapped by them.

This can be confusing because the sibling-order is not necessarily the same as the visual order, and the sibling order is not always apparent from the design view.

The Document outline window (View -> Other Windows -> Document outline) gives a useful tree-view over the control hierarchy and order, and allows you to change the sibling order of controls.

You can also change sibling order directly in the designer by context menu -> Bring to front / Send to back, which moves the control to be first or last of the siblings. These menu labels may be somewhat confusing since the actual effect depends on the layout model.

With fixed positioned controls, the 2D position is independent of the sibling order, but when controls are overlapping, the control earliest in the order will be "on top", hiding part of siblings later in the order. In this context Bring to front / Send to back makes sense.

Inside flow- or table-layout panels, the creation order determines the visual order of the controls. There is no overlapping controls. So bring to front/send to back really means make first or last in the order of controls.

With docked layout, the bring to front / send to back may be even more confusing since it determines in which order the docking is calculated, so "bring to front" on a fill-docked control will place the control in the middle of the parent, taking all edge-docked controls into account.

这篇关于Panel.Dock填补忽视其他Panel.Dock设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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