Save richtextbox wpf c#
how can I save more than one richtextbox whith design in my text editor in wpf c#
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Hemant KumarPosted Jan 3, 2012, 12:32 AM
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[^].