Wednesday, 28 October 2020

WPF GRID WITH SPLITTER (HORIZONTAL AND VERTICAL)

 

VERTICAL GRID WITH SPLITTER 

 

<Window x:Class="Wpf_Material_Lib_Intro.GridVertical"

        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:Wpf_Material_Lib_Intro"

        mc:Ignorable="d"

        Title="GridVertical"

        Height="450"

        Width="800">

    <Grid>

        <Grid.RowDefinitions>

            <RowDefinition Height='*'></RowDefinition>

            <RowDefinition Height='10'></RowDefinition>

            <RowDefinition Height='*'></RowDefinition>

        </Grid.RowDefinitions>

        <TextBlock Grid.Row='0'

                   Background='Red'

                   Text='TOP Side Gird Row'

                   FontSize='50'

                   TextWrapping='Wrap'

                   VerticalAlignment='Center'></TextBlock>

        <GridSplitter Grid.Row='1'

                      Height='10'

                      HorizontalAlignment='Stretch'

                      Background='Black'></GridSplitter>

        <TextBlock Text='BOTTOM Side Gird Column'

                   FontSize='50'

                   Background='Blue'

                   Grid.Row='2'

                   TextWrapping='Wrap'

                   VerticalAlignment='Center'></TextBlock>

    </Grid>

</Window>


 

HORIZONTAL GRID WITH SPLITTER

 

<Window x:Class="Wpf_Material_Lib_Intro.GirdHorizontal"

        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:Wpf_Material_Lib_Intro"

        mc:Ignorable="d"

        Title="GirdHorizontal"

        Height="450"

        Width="800">

    <Grid>

        <Grid.ColumnDefinitions>

            <ColumnDefinition Width='*'></ColumnDefinition>

            <ColumnDefinition Width='10'></ColumnDefinition>

            <ColumnDefinition Width='*'></ColumnDefinition>

        </Grid.ColumnDefinitions>

        <TextBlock Grid.Column='0'

                   Background='Red'

                   Text='Left Side Gird Column'

                   FontSize='50'

                   TextWrapping='Wrap'

                   VerticalAlignment='Center'></TextBlock>

        <GridSplitter Grid.Column='1'

                      Width='10'

                      HorizontalAlignment='Stretch'

                      Background='Black'></GridSplitter>

        <TextBlock Text='Right Side Gird Column'

                   FontSize='50'

                   Background='Blue'

                   Grid.Column='2'

                   TextWrapping='Wrap'

                   VerticalAlignment='Center'></TextBlock>

    </Grid>

</Window>


 

No comments:

Post a Comment