Wrap Text in Listbox RRS feed

  • Question

  •  I have a textBlock in my ListBox and I would like to wrap it wo the width of the Listbox. I tried adding a Width = "180" to the TextBlock, but then, my Name String just gets cut...How do I wrap the text so that I won't get a ScrollBar on the buttom?

    	<ListBox Height="110" Width="181" x:Name="FormularListBox" Background="{x:Null}" BorderBrush="{x:Null}">
                                        <TextBlock Text="{Binding Name}" Margin="5"/>
                                    <SolidColorBrush Color="{StaticResource BorderColor}"/>
    Thursday, May 14, 2009 7:47 AM


  • <TextBlock Text="{Binding Name}" Margin="5" TextWrapping="Wrap" />


    Thursday, May 14, 2009 8:21 AM

All replies