I'm trying to make a WPF TextBox fill all available space between two buttons. For some reason the code below does not what I'm trying to achieve
<DockPanel Height="48" LastChildFill="False">
<Button DockPanel.Dock="Left">
<Image Source="Images\large_load.png"></Image>
</Button>
<Button DockPanel.Dock="Left">
<Image Source="Images\large_reload.png"></Image>
</Button>
<TextBox Height="24" HorizontalAlignment="Stretch" DockPanel.Dock="Left"></TextBox>
<Button DockPanel.Dock="Right" Width="48">
<Image Source="Images\large_delete.png"></Image>
</Button>
</DockPanel>
The TextBox is not stretched.
Another problem is that when text is added, the textbox width increases and eventually it pushes the right button out of the visible space.