每当我们移动红色 gridsplitter 时,它都不会改变绿色列的大小。
<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Name="c1" ></ColumnDefinition>
<ColumnDefinition Name="c2" Width="auto" ></ColumnDefinition>
<ColumnDefinition Name="c3" Width="200" ></ColumnDefinition>
<ColumnDefinition Name="c4" Width="auto" ></ColumnDefinition>
<ColumnDefinition Name="c5" Width="200" ></ColumnDefinition>
</Grid.ColumnDefinitions>
<Border Name="t1" Grid.Column="0" Background="Transparent" ></Border>
<Border Name="t2" Grid.Column="2" Background="CadetBlue" ></Border>
<Border Name="t3" Grid.Column="4" Background="Green" ></Border>
<GridSplitter Name="gd1" Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="3" ></GridSplitter>
<GridSplitter Name="gd2" Background="red" Grid.Column="3" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="3"></GridSplitter>
</Grid>
</Window>