Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Here's some XAML that shows how to use a <code>GridSplitter</code> as you've described:</p> <pre><code>&lt;Grid VerticalAlignment="Stretch"&gt; &lt;Grid.RowDefinitions&gt; &lt;RowDefinition Height="10" /&gt; &lt;RowDefinition Height="10" /&gt; &lt;RowDefinition Height="10" /&gt; &lt;RowDefinition Height="10" /&gt; &lt;RowDefinition Height="10" /&gt; &lt;RowDefinition Height="10" /&gt; &lt;RowDefinition Height="*" /&gt; &lt;RowDefinition Height="*" /&gt; &lt;/Grid.RowDefinitions&gt; &lt;Rectangle Grid.Row="0" Fill="Red" /&gt; &lt;Rectangle Grid.Row="1" Fill="Orange" /&gt; &lt;Rectangle Grid.Row="2" Fill="Yellow" /&gt; &lt;Rectangle Grid.Row="3" Fill="Green" /&gt; &lt;Rectangle Grid.Row="4" Fill="Blue" /&gt; &lt;Rectangle Grid.Row="5" Fill="LightBlue" /&gt; &lt;ListBox Grid.Row="6" Background="Indigo"&gt; &lt;ListBoxItem&gt;Hello&lt;/ListBoxItem&gt; &lt;ListBoxItem&gt;World&lt;/ListBoxItem&gt; &lt;/ListBox&gt; &lt;GridSplitter Grid.Row="7" Height="5" Background="Gray" VerticalAlignment="Top" HorizontalAlignment="Stretch" /&gt; &lt;ListBox Grid.Row="7" Background="Violet" Margin="0,5,0,0"&gt; &lt;ListBoxItem&gt;Hello&lt;/ListBoxItem&gt; &lt;ListBoxItem&gt;World&lt;/ListBoxItem&gt; &lt;/ListBox&gt; &lt;/Grid&gt; </code></pre> <p>Avoid putting the GridSplitter in it's own row. Put it inside an existing row, and set it's alignment to the top (or bottom, if in the upper cell), stretched horizontally. Note how I've set it's height to 5, and then given an upper margin of 5 to the second ListBox so that neither element hides any part of the other.</p> <p>Hope that helps.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload