禁用WPF RichTextBox文本自动换行

时间:2022-11-13 11:02:32

I am using RichTexbox to display RTF text in my application, depends on windows width RichTextbox text auto wraps to next line!!

我正在使用RichTexbox在我的应用程序中显示RTF文本,取决于窗口宽度RichTextbox文本自动换行到下一行!

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)

我想禁用文本自动扭曲,而不是我想显示滚动条,我也不想设置FlowDocument的PageWidth以避免文本换行(因为我显示RTF文本我不能根据字符/大小/来衡量PageWidth文本的字体/字体样式,因为每个字符可能包含不同的字体样式和大小)

 <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

我已经在MSDN论坛中讨论了这个问题,也反映了现有的stackflow disussions WPF RichTextBox自动换行和Wpf RichTextBox包装问题

Thank you

Santhosh Devi

1 个解决方案

#1


0  

Third partycontrol syncfusion control SfRichTextBoxAdv has a solution for this issue

第三方控制同步控制SfRichTextBoxAdv有一个解决此问题的方法

#1


0  

Third partycontrol syncfusion control SfRichTextBoxAdv has a solution for this issue

第三方控制同步控制SfRichTextBoxAdv有一个解决此问题的方法