What's the "conceptual" difference between TextWrapping="Wrap"
and TextWrapping="WrapWithOverflow"
(e.g. for a TextBox)?
In the MSDN page about the class TextBox there is nothing …
Thank you.
WPF text Wrap vs WrapWithOverflow
word-wrapwpf
Related Topic
- How to wrap text in LaTeX tables
- Html – How to wrap text of HTML button with fixed width
- Vim command to restructure/force text to 80 columns
- Wpf – Difference between SelectedItem, SelectedValue and SelectedValuePath
- C# – How to wrap text in a label using WPF
- Android – Auto Scale TextView Text to Fit within Bounds
- C# – Page vs Window in WPF
- C# – Window vs Page vs UserControl for WPF navigation
Best Answer
Some examples:
This is the original, unwrapped version:
This is
NoWrap
.This is
Wrap
. The wordsRemove
andSample
have been wrapped at theve
andle
, respectively, even though there is no line break opportunity.This is
WrapWithOverflow
. Theve
andle
are not visible (they overflow the available block width) because there is no line break opportunity. TheAll
, in both cases, has been wrapped because thespace
character is a line break opportunity.Edit:
As suggested in the comments, here's some examples of how
Wrap
treats spaces. WhenWidth
is100
,Wrap
andWrapWithOverflow
are identical.Wrap
treats the space betweenwider
andexample
as a line-break opportunity, soexample
is put on a new line to preserve the entire, continuous word.