WPF-Base/WPF基础-5-DockPanel1/MainWindow.xaml

17 lines
882 B
XML

<Window x:Class="WPF基础_5_DockPanel.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<!-- 靠边停靠 -->
<DockPanel LastChildFill="True">
<Button DockPanel.Dock="Top">DockPanel.Dock="Top"</Button>
<Button DockPanel.Dock="Bottom">DockPanel.Dock="Bottom"</Button>
<Button DockPanel.Dock="Left">DockPanel.Dock="Left"</Button>
<Button DockPanel.Dock="Right">DockPanel.Dock="Right"</Button>
<!-- LastChildFill="True" 告诉Dock占满空间 -->
<Button>中間的</Button>
</DockPanel>
</Window>