GridSplitter Example : GridSplitter « Windows Presentation Foundation « C# / CSharp Tutorial






<Window x:Class="SDKSample.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Row GridSplitter Example">


        <StackPanel Grid.Row="0" Grid.Column="0">

            <Grid >
                <Grid.RowDefinitions>
                    <RowDefinition Height="50" />
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition/>
                    <ColumnDefinition/>
                    <ColumnDefinition/>
                </Grid.ColumnDefinitions>

                <StackPanel Grid.Row="0" Grid.Column="0" 
                      Background="Red"/>
                <StackPanel Grid.Row="0" Grid.Column="1" 
                      Background="Black"/>
                <StackPanel Grid.Row="0" Grid.Column="2" 
                      Background="Tan"/>

                <StackPanel Grid.Row="1" Grid.Column="0" 
                      Background="Tan"/>
                <StackPanel Grid.Row="1" Grid.Column="1" 
                      Background="Brown"/>
                <StackPanel Grid.Row="1" Grid.Column="2" 
                      Background="Blue"/>

                <StackPanel Grid.Row="2" Grid.Column="0" 
                      Background="Red"/>
                <StackPanel Grid.Row="2" Grid.Column="1" 
                      Background="Blue"/>
                <StackPanel Grid.Row="2" Grid.Column="2" 
                      Background="Tan"/>

                <GridSplitter Grid.Row="1" 
                        Grid.ColumnSpan="3" 
                        HorizontalAlignment="Stretch" 
                        VerticalAlignment="Top"
                        Background="Black" 
                        ShowsPreview="true"
                        ResizeDirection="Columns"
                        Height="5"/>
                <GridSplitter Grid.Column="1" 
                        Grid.RowSpan="3" 
                        HorizontalAlignment="Left" 
                        VerticalAlignment="Stretch"
                        Background="White" 
                        ShowsPreview="true"
                        Width="5"/>
            </Grid>

        </StackPanel>



</Window>
WPF Grid Splitter Example








24.46.GridSplitter
24.46.1.Define a GridSplitter and ShowsPreview ChangedDefine a GridSplitter and ShowsPreview Changed
24.46.2.GridSplitter and ResizeBehaviorChangedGridSplitter and ResizeBehaviorChanged
24.46.3.Define a GridSplitter and Resize Direction ChangedDefine a GridSplitter and Resize Direction Changed
24.46.4.Define a GridSplitter and Keyboard IncrementDefine a GridSplitter and Keyboard Increment
24.46.5.GridSplitter and DragIncrement ChangedGridSplitter and DragIncrement Changed
24.46.6.Define a GridSplitter and Vertical Alignment ChangedDefine a GridSplitter and Vertical Alignment Changed
24.46.7.Define a GridSplitter and Horizontal Alignment ChangedDefine a GridSplitter and Horizontal Alignment Changed
24.46.8.GridSplitter ExampleGridSplitter Example
24.46.9.GridSplitter as Entire Column or RowGridSplitter as Entire Column or Row
24.46.10.Grid With SplitterGrid With Splitter
24.46.11.Use GridSplitterUse GridSplitter
24.46.12.Stretched GridSplitterStretched GridSplitter
24.46.13.Grid Splitter and AlignmentGrid Splitter and Alignment