#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:



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




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 Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: