[英]how to set RTF from WinForms to WPF RichTextBox
how to set RTF from WinForms to WPF RichTextBox
. 如何将RTF从WinForms设置为WPF
RichTextBox
。 (Not by TextRange.Load()
). (不是
TextRange.Load()
)。
I have a string variable which has rtf text. 我有一个带有rtf文本的字符串变量。 I want to set this variable to wpf ritch text box.
我想将此变量设置为wpf ritch文本框。
I got the solution. 我找到了解决方案。
MemoryStream stream = new MemoryStream(ASCIIEncoding.Default.GetBytes(text));
ritchTextBox.Selection.Load(stream, DataFormats.Rtf);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.