Dock 枚举

定义

指定 Dock 内子元素的 DockPanel 位置。Specifies the Dock position of a child element that is inside a DockPanel.

public enum class Dock
public enum Dock
type Dock = 
Public Enum Dock
继承

字段

Bottom 3

位于 DockPanel 底部的子元素。A child element that is positioned at the bottom of the DockPanel.

Left 0

位于 DockPanel 左侧的子元素。A child element that is positioned on the left side of the DockPanel.

Right 2

位于 DockPanel 右侧的子元素。A child element that is positioned on the right side of the DockPanel.

Top 1

位于 DockPanel 顶部的子元素。A child element that is positioned at the top of the DockPanel.

注解

如果将 system.windows.controls.dockpanel> 属性设置为true(这是默认设置), 则 system.windows.controls.dockpanel> 的最后一个子元素将始终填充剩余空间, 而不考虑在最后一个子元素上设置的任何其他 dock 值。If you set the DockPanel.LastChildFill property to true, which is the default setting, the last child element of a DockPanel always fills the remaining space, regardless of any other dock value that you set on the last child element. 若要将子级停靠在另一个方向, 必须将 system.windows.controls.dockpanel> 属性设置为false , 并且还必须在最后一个子元素上设置显式停靠方向。To dock a child in another direction, you must set the DockPanel.LastChildFill property to false and must also set an explicit dock direction on the last child element.

适用于

另请参阅