How to get RTF from RichTextBox
问题 How do I get the text in RTF of a RichTextBox ? I'm trying to get like this, but the property does not exist. RichTextBox rtb = new RichTextBox(); string s = rtb.Rtf; 回答1: To get the actual XAML created by the user inside of the RichTextBox: TextRange tr = new TextRange(myRichTextBox.Document.ContentStart, myRichTextBox.Document.ContentEnd); MemoryStream ms = new MemoryStream(); tr.Save(ms, DataFormats.Xaml); string xamlText = ASCIIEncoding.Default.GetString(ms.ToArray()); EDIT: I don't have