WPF Textblock, linebreak in Text attribute

后端 未结 15 1488
南方客
南方客 2021-02-03 16:37

Is there a way to have \\n make a line break in a TextBlock?


Or is there a

15条回答
  •  名媛妹妹
    2021-02-03 17:10

    The Best way that worked for me for multiple lines in the same Textblock is:

      
        text1  
          
        text2  
    
    

    Make sure to not use TextWrapping="Wrap". Use TextWrapping="NoWrap" or use nothing.

提交回复
热议问题