The DockPanel.Dock property determines the position of the element, based on the relative order. The property is of type Dock enumeration and it accepts the following values—Dock.Left, Dock.Right, Dock.Top, and Dock.Bottom. If you don't specify the property, by default, the first element will be docked to the left and the other elements will take the remaining space.
In the preceding example, the labels are added inside the DockPanel in the following order, having the DockPanel.Dock property set to Right, Top, Bottom, and Left, respectively. The last label does not specify any Dock property and hence it takes the remaining space to accommodate itself inside it.