Reputation: 588
I have a few TextBoxes
inside a StackPanel
like this:
...
<StackPanel Orientation="Horizontal">
<TextBox Text="1"></TextBox>
<TextBox Text="1"></TextBox>
<TextBox Text="1"></TextBox>
</StackPanel>
...
I would like the StackPanel
to grow as the TextBox
es are typed into, but instead, the TextBox
es wrap as more text is added.
How can I make the StackPanel
to grow as the TextBox
es are typed into?
Thanks in advance!
Upvotes: 0
Views: 33
Reputation: 3968
When I try your solution it works for me.
But you could try to add the property TextWrapping="NoWrap"
to each TextBox
or create a Style
.
Or you could use instead of a StackPanel
a Grid
which does also work
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefiniton Width="Auto" />
<ColumnDefiniton Width="Auto" />
<ColumnDefiniton Width="Auto" />
</Grid.ColumnDefinitions>
<TextBox Grid.Column="0" Text="1" />
<TextBox Grid.Column="1" Text="1" />
<TextBox Grid.Column="2" Text="1" />
</Grid>
Upvotes: 1