Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

Dock Enumeration

Specifies the Dock position of a child element that is inside a DockPanel.

Namespace:  System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)

public enum class Dock
<object property="enumerationMemberName" .../>

Member nameDescription
LeftA child element that is positioned on the left side of the DockPanel.
TopA child element that is positioned at the top of the DockPanel.
RightA child element that is positioned on the right side of the DockPanel.
BottomA child element that is positioned at the bottom of the DockPanel.

If you set the 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. To dock a child in another direction, you must set the LastChildFill property to false and must also set an explicit dock direction on the last child element.

The following example creates and uses an instance of DockPanel by using code. The example shows you how to partition space by creating five Rectangle elements and positioning (docking) them inside a parent DockPanel. If you retain the default setting, the final rectangle fills all the remaining unallocated space.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Community Additions

ADD
Show:
© 2015 Microsoft