Resource

Wrap text in a WPF Label

XAML Designer Resources 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.
  • 0
  • 0
  • 27346

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>
COMMENT USING

PREMIUM SPONSORS

Hire Mobile & Web Developer on demand. 100% satisfaction. Try for 1 week or Money Back. Local and remote developers available all over USA.

TOP RESOURCES

MOST LIKED RESOURCES