Thursday, August 4, 2011

How to set this text into WPF RichTextBox?


Solution:

        public void SetRTFText(string text)
  {
   MemoryStream stream = new MemoryStream(ASCIIEncoding.Default.GetBytes(text));
   this.mainRTB.Selection.Load(stream, DataFormats.Rtf);
  }

Refference

No comments:

Post a Comment