Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Two Rows in a Horizontal Stack Panel? (WPF)

I have this stack panel (contains four fractions):

enter image description here

(Fractions are just text with new lines and hyphens.) If I add a fifth fraction, it'll go to the right of 10/12, instead of forming a second row.

How do I configure my StackPanel so that it'll overflow into a second row (and stay within the bounds of the StackPanel) instead of overflowing invisibly?

Markup:

<StackPanel Name="_fractionContainer" Width="700" Height="600"
      Orientation="Horizontal" Margin="8, 8, 8, 8" Background="White" />  
like image 772
ashes999 Avatar asked May 07 '11 21:05

ashes999


1 Answers

Use a wrap panel instead

<WrapPanel Name="_fractionContainer" Orientation="Horizontal" ...>
like image 166
J Cooper Avatar answered Oct 21 '22 23:10

J Cooper