Hi all,
I’d like to know how to show a multi-line text in a TextBox.
I tried with “\n\r”, “\r\n”, Evvironment.NewLine but none works. The text of the only line shown is terminated with “…” if the TextBox width is lower than the string length.
The old “Text” component has a “TextWrap” property that works, but the center vertical alignment does not.
I init the component like this:
…
txtMessage = new TextBox()
{
Height = 300,
Width = 150,
Foreground = new SolidColorBrush(Colors.White),
Background = new SolidColorBrush(UI_Colors.Black),
Font = UI_Fonts.UBfont18B,
TextAlign = TextAlignment.Center,
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
Text = strMsg
};
I’d like that it displays single or multiple lines , always centered both vertically and horizontally in the given size (Width, height).
Thanks in advance for any help.
Best,
Vittorio