Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Wrap and WrapWithOverflow
Message
From
23/12/2009 04:13:10
 
 
To
22/12/2009 23:09:50
General information
Forum:
ASP.NET
Category:
Windows Presentation Foundation (WPF)
Environment versions
Environment:
C# 3.0
Miscellaneous
Thread ID:
01440053
Message ID:
01440306
Views:
26
>>Hi,
>>
>>Can anyone point me to a clear explanation of the differences between TextWrapping.WrapWithOverflow and TextWrapping.Wrap
>>
>>The behaviour that I see seems counter-intuitive:
>>
>>If, usingTextWrapping.Wrap, I type in a word that is too long to fit the available width it will automatically wrap the excess to the next line.
>>
>>With TextWrapping.WrapWithOverflow if does not.......
>>
>>Feels to me it should be the other way around ?
>
>http://msdn.microsoft.com/en-us/library/system.windows.textwrapping.aspx
>
>Wrap: Line-breaking occurs if the line overflows beyond the available block width, even if the standard line breaking algorithm cannot determine any line break opportunity, as in the case of a very long word constrained in a fixed-width container with no scrolling allowed.
>
>WrapWithOverflow: Line-breaking occurs if the line overflows beyond the available block width. However, a line may overflow beyond the block width if the line breaking algorithm cannot determine a line break opportunity, as in the case of a very long word constrained in a fixed-width container with no scrolling allowed.
>
>Based on that wrap will always wrap, WrapWithOverflow will only wrap if it finds a valid place to break the line.

>
>"WrapWithOverflow " just plain seems like a bad choice of words to describe what it's doing. WrapOnValidBreakOnly might have been a better choice.

I think the source of my confusion was thinking of 'WrapWithOverflow' as meaning 'Wrap ON overflow'
IAC your suggested name is better (though longer :-{ )
Best,
Viv
Previous
Reply
Map
View

Click here to load this message in the networking platform