What is Dock Panel

Dock panel is panel which allows you to arrange controls on left, right, top and bottom. At the time of control adding you have to set the property DockPanel.Dock either on left, right, top, and bottom.

Example of Dock Panel

	<Window x:Class="WpfApplication2.MainWindow"
        Title="Tech Altum" Height="500" Width="700">

        <Button DockPanel.Dock="Left" >Left Button</Button>
        <Button DockPanel.Dock="Bottom">Bottom Button</Button>
        <Button DockPanel.Dock="Right">Right Button</Button>
        <Button DockPanel.Dock="Top">Top Button</Button>
        <Button>Extra Space</Button>

The output of this example as follows:-

		dock panel in WPF

		Figure 1