How to add a new row when sharing text WinRt

I want to share some text using the mail client in windows 8, in which I want to display new lines. He correctly displays it in Notepad using \r\n , but does not work with the function SetText in DataTransferManager .

+4
source share
1 answer

The key is to set the text in HTML and not send it as a string.

Suppose that the text that you want to use is in a string textToShare; Please note that you will send in the HTML string, so you need to replace all of the new characters in the string <br/>

instead

 theRequest.Data.SetText(textToShare); 

using

 theRequest.Data.SetHtmlFormat(HtmlFormatHelper.CreateHtmlFormat(textToShare)); 
+2
source

All Articles