Resource

Wrap text in a WPF Label

XAML Designer Dec 16 2009
In WPF, the Label control does not support text wrapping. If you need a label that wraps contents across multiple lines, you can use a TextBlock control.
    • Like
    • Love It
    • Awesome
    • Interesting
    • It's Okay
    • Thumbs Down
  • 41.2k
  • 0

In WPF, the Label control does not support text wrapping. If you need a label that wraps contents across multiple lines, you can use a TextBlock control. Place a TextBlock control inside a Label and apply wrapping on TextBlock.

The following example shows how to use a TextBlock to make a label that wraps several lines of text.

<Label Name="Label1" Width="200" HorizontalAlignment="Left">
<TextBlock TextWrapping="WrapWithOverflow">
This is a Label with text wrapping feature. If text does not fit in a single line,
It will move to next line.
</TextBlock>
</Label>