I have a TextBox control in a StackPanel that has Orientation set to Horizontal but cannot force the TextBox to fill the remaining StackPanel space.
XAML:
<Window x:Class="WpfApplication1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Height="180" Width="324"> <StackPanel Background="Orange" Orientation="Horizontal" > <TextBlock Text="a label" Margin="5" VerticalAlignment="Center"/> <TextBox Height="25" HorizontalAlignment="Stretch" Width="Auto"/> </StackPanel> </Window>
And here is what it looks like:

Why doesn't the TextBox populate the StackPanel?
I know that I can have more control using the Grid control, I'm just confused in the layout.
Hank Sep 17 '10 at 16:16 2010-09-17 16:16
source share