#924 – TextBox Wrap vs. WrapWithOverflow

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:

924-001

 

Here’s the same text with TextWrapping=WrapWithOverflow.  The long word extends beyond the right side of the TextBox.

924-002

 

About Sean
Software developer in the Twin Cities area, passionate about software development and sailing.

4 Responses to #924 – TextBox Wrap vs. WrapWithOverflow

  1. Pingback: Dew Drop – October 10, 2013 (#1,642) | Morning Dew

  2. Fabian says:

    Nice and simple to understand.
    Thanks 🙂

Leave a comment