Question: Easy question, I have a stack panel with a toolbar and listbox, I want the listbox to fill the remaining space, but it won't. Here's what I have at the moment.

```
<Window x:Class="TestClientMainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Testing client" Height="350" Width="525"
    DataContext="{StaticResource ResourceKey=TheViewModel}" Background="#FFD4BFBF">
<Grid>
    <StackPanel HorizontalAlignment="Stretch" Name="stackPanel1" VerticalAlignment="Stretch">
        <ToolBar Height="26" Name="toolBar1" />
        <ListBox Name="listBox1" VerticalAlignment="Stretch" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" MinHeight="{Binding ElementName=stackPanel1, Path=Height}" Height="99" />
    </StackPanel>
</Grid>

```

Answer: 
Try using a `DockPanel` instead of a `StackPanel`. That way you can set `LastChildFill` to true and your `ListBox`, being the last contained element, will stretch to fill up its remaining space:

```
<DockPanel LastChildFill="True" HorizontalAlignment="Stretch" Name="dockPanel1" VerticalAlignment="Stretch">
    <ToolBar Height="26" Name="toolBar1" />
    <ListBox Name="listBox1" VerticalAlignment="Stretch" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" MinHeight="{Binding ElementName=stackPanel1, Path=Height}" Height="99" />
</DockPanel>

```
A StackPanel will not be easily convinced to do what you want.

I would use a Grid instead.