C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
Then: Drag a GridSplitter element to the Grid. You will need to adjust some attributes on it.
Tip: Please set the Grid.Row attribute on the other elements of your Grid. The first row is index 0, and the second row is 1.
Example markup: XAML
<Window x:Class="WpfApplication23.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.RowDefinitions>
<RowDefinition Height="60"/>
<RowDefinition Height="60"/>
</Grid.RowDefinitions>
<Button Content="In row 0" HorizontalAlignment="Left" Margin="10"
VerticalAlignment="Top" Width="75"
Grid.Row="0"/>
<Button Content="In row 1" HorizontalAlignment="Left" Margin="10"
VerticalAlignment="Top" Width="75"
Grid.Row="1"/>
<GridSplitter Height="10" HorizontalAlignment="Stretch" Margin="0"
VerticalAlignment="Top"
ResizeDirection="Rows"
ShowsPreview="True"
Grid.Row="1"/>
</Grid>
</Window>
And: When ShowsPreview is left as False, the grid will resize automatically as the splitter is dragged.
Tip: When using GridSplitter, many of these elements must be added through the XAML editor. Drag and drop support is not always available.