#924 – TextBox Wrap vs. WrapWithOverflow
October 9, 2013 4 Comments
When you specify that you want to wrap text within a TextBox, you can set the TextWrapping property to one of:
- NoWrap
- Wrap
- WrapWithOverflow
The WrapWithOverflow indicates that words will be wrapped, wrapping at the nearest space. But if there is some text that won’t fit into the available space after wrapping at word boundaries, the TextBox will just let the text extend beyond the boundaries of the TextBox. By contrast, when you specify TextWrapping=Wrap, if the text won’t fit after wrapping at a word boundary, it just wraps in the middle of the word.
Here’s an example of long word wrapping with TextWrapping=Wrap:
Here’s the same text with TextWrapping=WrapWithOverflow. The long word extends beyond the right side of the TextBox.
Pingback: Dew Drop – October 10, 2013 (#1,642) | Morning Dew
Nice and simple to understand.
Thanks 🙂
Better than MSDNs explanatiom
Thanks Damien!