tags:

views:

36

answers:

1

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 set this variable to wpf ritch text box.

A: 

Hi guys, I got the solution.

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

Jeevan Bhatt