C#C
C#3y ago
bribri

✅ Problems with wrapping in wpf Listbox

I'm using an listbox to to list multiple options with an image and title. But I want to let my title wrap when smaller etc but I can't seem to do it ... You can see it in image and my code for the box. Should I use listbox for this or an other control? I really need the scroll option for it. (this is still early with some placeholder stuff)

<ListBox Grid.Column="1" ScrollViewer.CanContentScroll="False">
            <ListBoxItem>
                <StackPanel Orientation="Horizontal">
                    <TextBlock x:Name="titel" HorizontalAlignment="Center" VerticalAlignment="Center" TextWrapping="WrapWithOverflow"/>
                    <Image Source="placeholder.png" Width="150" Height="150" HorizontalAlignment="Right"/>
                </StackPanel>
            </ListBoxItem>
        </ListBox>
image.png
Was this page helpful?