I am using RichTexbox to display RTF text in my application, depends on windows width RichTextbox text auto wraps to next line!!
I want to disable the text auto warp, instead i want to display scroll bar, Also i don't want to set PageWidth of the FlowDocument to avoid text wrapping (since am displaying RTF text i cant measure the PageWidth based on character/size/Font/Font style of the text because each and every character may contains different font style and size)
<RichTextBox HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
<FlowDocument >
<Paragraph>
<Run Text="RichTextBoxRichTextBoxRichTextBoxRichTextBoxRichTextBoxRichTextBoxRichTextBoxRichTextBoxRichTextBoxRichTextBoxRichTextBoxRichTextBoxRichTextBoxRichTextBoxRichTextBoxRichTextBoxRichTextBoxRichTextBoxRichTextBoxRichTextBoxRichTextBox"/>
</Paragraph>
</FlowDocument>
Is there any other existing property is there to control auto wrapping or can we handle this without measure text size
I have already discussed about this in MSDN forum also reffered existing stackflow disussions WPF RichTextBox word wrapping and Wpf RichTextBox wrapping problems
Thank you
Santhosh Devi
<FlowDocument PageWidth="10000">
- Set the document's PageWidth to a BIG number. This looks like the only option. Why you don't want to set PageWidth ? stackoverflow.com/questions/1368047/…FlowDocument
is perhaps not the best choice (though it is certainly better thanFixedDocument
). If you're displaying content with excessively long lines, the document layout/formatting costs may add up significantly as the document grows in size. Alas, aFlowDocument
is what you get when you use aRichTextBox
. If you must display RTF content, you may not have much of a choice. But if we knew more about what you are displaying, perhaps we could offer a more appropriate alternative.