WPF grid column resize via GridSpitter, when you can drag to enlarge or shrink the current column width

<Window x:Class="WpfApp137.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"
        xmlns:local="clr-namespace:WpfApp137"
        mc:Ignorable="d" WindowState="Maximized"
        Title="MainWindow" Height="450" Width="800">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <Image Grid.Column="0" Source="Images\cl1.jpeg"/>
        <GridSplitter Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Stretch"
                      Width="5" Background="Black" ShowsPreview="True"/>
        <Image Grid.Column="2" Source="Images\cl1.jpg"/>
    </Grid>
</Window>

 

 

 

 

 

 

 

posted @ 2024-06-06 17:09  FredGrit  阅读(1)  评论(0编辑  收藏  举报