Getting parameter - incorrect error with TextWrapping property set in WrapWholeWords?

In my C # / WinRT application (Windows Store app) I have a TextBox. I can set the TextWrapping property to Wrap or NoWrap, and it works. But if I try to use the value "WrapWholeWords", I get a design-time error with the property value highlighted. When I am on the error, I get the error "parameter is incorrect" with error code E_RUNTIME_SETVALUE. Can someone tell me why this is happening and how to fix it if possible?

<TextBox x:Name="txtNotes" Grid.Column="2" TextWrapping="WrapWholeWords" Text="TextBlock" Margin="30" FontSize="20"/> 

A TextBox is placed on the grid control, if that matters. Note that the WrapWholeWords value is offered by Intellisense from the XAML editor and in the property editor panel in the IDE.

+5
source share
1 answer

Is not allowed.

TextBox and RichEditBox do not support the WrapWholeWords value for their TextWrapping properties. If you try to use WrapWholeWords as the value for TextBox.TextWrapping or RichEditBox.TextWrapping, an invalid argument exception is thrown.

Above was copied from this link: Link

+8
source

Source: https://habr.com/ru/post/1201111/


All Articles