WPF TextBlock 文本换行的两种方式

第一种:

<TextBlock>

    This is line 1.<LineBreak/>

    This is line 2.

</TextBlock>

 

 

第二种

 

<TextBlock xml:space="preserve">This is line 1.

    This is an indented line 2.</TextBlock>

 

 

第二种加了xml:space="preserve",可以直接在文本上按space,tab键,不用标记,比较方便

 

转:http://www.cnblogs.com/xuwenfeng/articles/2159657.html

posted on 2014-04-04 13:51  ExplorerMan  阅读(766)  评论(0编辑  收藏  举报

导航