<Window x:Class="DockPanelSample.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="DockPanel范例" Height="221" Width="332">
    <DockPanel Name="dockPanel1">
        <Button Content="上方" Height="23" Name="button1" DockPanel.Dock="Top" VerticalAlignment="Top" />
        <Button Content="下方" Height="23" Name="button2" DockPanel.Dock="Bottom" VerticalAlignment="Bottom" />
        <Button Content="左方" Name="button3" Width="75" HorizontalAlignment="Left" />
        <Button Content="右方" Name="button4" Width="75" HorizontalAlignment="Right" DockPanel.Dock="Right" />
        <TextBox Name="textBox1" />
    </DockPanel>
</Window>
