开发者

how to set RTF from WinForms to WPF RichTextBox

how to set RTF from WinForms to WPF RichTextBox. (Not by TextRange.Load()).

I have a string variable which has rtf text. I want to s开发者_运维知识库et this variable to wpf ritch text box.


I got the solution.

MemoryStream stream = new MemoryStream(ASCIIEncoding.Default.GetBytes(text));
ritchTextBox.Selection.Load(stream, DataFormats.Rtf);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜