简体   繁体   English

禁用WPF RichTextBox文本自动换行

[英]Disable WPF RichTextBox text auto wrapping

I am using RichTexbox to display RTF text in my application, depends on windows width RichTextbox text auto wraps to next line!! 我正在使用RichTexbox在我的应用程序中显示RTF文本,取决于Windows宽度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论坛中讨论了此问题,还提到了现有的堆栈流争议WPF RichTextBox换行Wpf RichTextBox换行问题

Thank you 谢谢

Santhosh Devi 桑索什·德维(Santhosh Devi)

第三方控件同步融合控件SfRichTextBoxAdv具有此问题的解决方案

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM