Save richtextbox wpf c#
how can I save more than one richtextbox whith design in my text editor in wpf c#
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Hemant KumarRank #1,202 · 1.5K reputationPosted Jan 2, 2012, 7:32 PM EST
Document, see http://msdn.microsoft.com/en-us/library/system.windows.controls.richtextbox.document.aspx[^].So, to store or load the document, you need to work with this property of the type
System.Windows.Documents.FlowDocument, http://msdn.microsoft.com/en-us/library/system.windows.documents.flowdocument.aspx[^].Through this class and property, you can manipulate the document, in particular, persist it. The manipulation of the data depends on
DataTemplateyou use, see http://msdn.microsoft.com/en-us/library/system.windows.datatemplate.aspx[^].To store and load the document, you can use the class
TextRangewhich you can get from your instance ofRichTextBox. For a code sample, see: http://msdn.microsoft.com/en-us/library/aa970779.aspx#save_load_and_print_richtextbox_content[^].