WPF-Base/WPF基础-6-Grid9分隔窗口2/MainWindow.xaml

49 lines
2.3 KiB
Plaintext
Raw Normal View History

2024-12-30 21:01:35 +08:00
<Window x:Class="WPF基础_6_Grid9分隔窗口2.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">
<Grid ShowGridLines="True" UseLayoutRounding="True">
<Grid.ColumnDefinitions>
<ColumnDefinition MinWidth="150" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition MinWidth="100" />
</Grid.ColumnDefinitions>
<!-- 整个盒子的分隔 -->
<GridSplitter Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Stretch" Width="5"
ShowsPreview="False" Background="Coral" />
<!-- 左侧列 -->
<Grid Grid.Column="0" ShowGridLines="True" UseLayoutRounding="True" VerticalAlignment="Stretch">
<Grid.RowDefinitions>
<RowDefinition Height="*" MinHeight="150" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" MinHeight="150" />
</Grid.RowDefinitions>
<GridSplitter Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Center" Height="5"
ShowsPreview="True" Background="Chocolate" />
<Button Grid.Row="0" Grid.Column="0">0-0</Button>
<Button Grid.Row="2" Grid.Column="0">0-1</Button>
</Grid>
<!-- 右侧列 -->
<Grid Grid.Column="2" ShowGridLines="True" UseLayoutRounding="True" HorizontalAlignment="Stretch">
<Grid.RowDefinitions>
<RowDefinition Height="*" MinHeight="150" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" MinHeight="100" />
</Grid.RowDefinitions>
<!-- 右侧分隔 -->
<GridSplitter Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Center" Height="5"
ShowsPreview="False" Background="Coral" />
<Button Grid.Row="0" Grid.Column="0">1-0</Button>
<Button Grid.Row="2" Grid.Column="0">1-1</Button>
</Grid>
</Grid>
</Window>