Contact me
   My PGP Key

Gridsplitter Layout Sample

How to get this code going: Create a Windows Presentation Foundation project named LayoutSample and paste the following code in the specified file.

Paste this code into Window1.xaml:

<Window x:Class="LayoutSample.Window1"
    Title="Window1" Height="398" Width="564">
            <ColumnDefinition Width="126" />
            <ColumnDefinition Width="288*" />
        <StackPanel Grid.Column="0" Margin="0,0,0,0" Name="stackPanel1" Background="AliceBlue">
            <!-- Left side content -->

        <Grid Grid.Column="1" Margin="5, 0, 0, 0">
                <RowDefinition Height="58" />
                <RowDefinition Height="177*" />
            <Grid Grid.Row="0" Background="Red">
                <!-- Top right content -->
                <Label>Top right</Label>
            <StackPanel Grid.Row="1" Background="Beige" Margin="0,5,0,0">
                <!-- Bottom right content -->
                <Label>Bottom right</Label>
            <GridSplitter Grid.Row="1" HorizontalAlignment="Stretch" Margin="5,0,0,0" Name="gridSplitter2" Height="10" VerticalAlignment="Top" />
        <GridSplitter Grid.Column="1" HorizontalAlignment="Left" Name="gridSplitter1" Width="10" VerticalAlignment="Stretch" />


Compile and run.

Layout Sample

Comment in the forum

Sitemap generated by Sitemap Manager