How to represent Line Break or new line in silverlight textBox

后端 未结 7 1333
逝去的感伤
逝去的感伤 2021-02-01 19:12

I am having hard time to match Special characters set in Silverlight. I only on the following:

To represent a LineBreak in Silverlight TextBlock:

use : > line

7条回答
  •  别跟我提以往
    2021-02-01 19:48

    To add a line break to the Text property of a TextBox in XAML, use the ASCII character code for a linefeed as shown in the following example:

    
    

    To add a line break to the Text property of a TextBox in code-behind, use the Environment.NewLine static value (which is the same as \r\n) as shown in the following code example:

    this._test.Text = string.Format(
        "This is line one.{0}This is line two.",
        Environment.NewLine);

提交回复
热议问题