0

From what i know about WrapPanel , once it reaches its limit , it will auto move to the next line but however is there anyway to make this nicer without adding extra panel ?

Now its something like this ( an example ) :

How you like to live on a houseboat with your family and pets [ textbox ] ( lots

/ all ) year round?

As you can see the brackets ( lots / all ) is being separated , is there any way to make them go to next line if they are together without adding extra panel ?

My xaml code :

 <Grid Background="#FFF0FA08">
    <WrapPanel x:Name="WrapPanelTest" HorizontalAlignment="Center" Height="658" VerticalAlignment="Center" Width="1366">                   
    </WrapPanel> // this Panel i am talking about.
    <StackPanel Height="110" Name="stackPanel1" Width="200" HorizontalAlignment="Left" VerticalAlignment="Bottom" >
        <Button Content="Check!" Height="100" Name="button1" Width="125" FontSize="35" Click="button1_Click" />
    </StackPanel>
</Grid>

How i add populate those content inside the wrap panel :

Basically i just retrieve it from database and create them dynamically and add to

wrappanel.children.add

, because the code is too long and i duno if it is related . I tried to add multiple panels inside to make it look nicer but i can only have one panel because thats the most easiest way i can find my controls. ( textboxes ) thats why i need to know if there is any way to do this without adding any panels

what
  • 373
  • 2
  • 10
  • 20

1 Answers1

0

Forget the wrappanell and just use TextWrapping="Wrap" in a textblock you can use WrapWithOverflow to wrap on whole words

But (lots / all) will still be separated, so you will have to remove the spaces and make it (lots/all)

Mark Homer
  • 960
  • 6
  • 15