Click here to Skip to main content
15,890,282 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how can I save in my texteditor that content three richtextbox to txt?
Posted

1 solution

The content of this control is defined by its property 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 DataTemplate you use, see http://msdn.microsoft.com/en-us/library/system.windows.datatemplate.aspx[^].

To store and load the document, you can use the class TextRange which you can get from your instance of RichTextBox. For a code sample, see: http://msdn.microsoft.com/en-us/library/aa970779.aspx#save_load_and_print_richtextbox_content[^].

—SA
 
Share this answer
 
Comments
Wendelius 2-Jan-12 14:00pm    
Thoroughly explained, 5. And Happy New Year :)
Sergey Alexandrovich Kryukov 2-Jan-12 14:01pm    
Thank you, Mika.
Best wishes in New Year!
--SA
RaviRanjanKr 2-Jan-12 14:09pm    
Nice Answer, My 5+
Sergey Alexandrovich Kryukov 2-Jan-12 14:10pm    
Thank you, Ravi.
Happy New Year!
--SA
RaviRanjanKr 2-Jan-12 14:16pm    
Same to you SA. :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900