WPF line break

Source: Internet
Author: User

Method 1:<textblock text= "first line & #x0a; second line"/>
Text in the middle plus:& #x0a;
You can do it. This method is useful and can also be used on the ToolTip:
<tooltip width= "" "content=" ' first line '
& #x0a;& #x0d; ' Second line '
& #x0a;& #x0d; ' The third line ' "/> method 2:<textblock xml:space=" preserve "> First row second row </TextBlock> Preserve can preserve whitespace in XAML method 3:< TextBlock text= "{Binding stringformat= ' first line {0} second row {0} third row ', source={x:static S:environment.newline}}"/>

<sys:string x:key= "newupdatewillshow" xml:space= "preserve" > First row & #13; second row & #13;</sys:string>

Line break for & #13;

The xml:space= "preserve" must be added, otherwise the newline character is invalid.

<sys:string x:key= "txteditortipsrc" xml:space= "preserve" > First row & #13;& #10; second row </sys:String>

Official documentation Reference: http://msdn.microsoft.com/zh-CN/library/cc189036 (vs.95). Aspx#whitespace

WPF line break

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.