Extended WPF Toolkit RichTextBox HorizontalScrollBarVisibility issue
when I am loading a text file to my window I am not getting horizontal ScrollBar at all any idea why ?
<UserControl x:Class="CAMXSimulator.View.LogView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:toolkit="clr-namespace:Microsoft.Windows.Controls;assembly=WPFToolkit.Extended">
<TabControl
AllowDrop="True"
PreviewDragOver="DragOver"
PreviewDrop="Drop"
>
<TabItem Header=" File">
<toolkit:RichTextBox AcceptsReturn="True"
AcceptsTab="True"
BorderBrush="Black"
BorderThickness="2"
ScrollViewer.HorizontalScrollBarVisibility="Auto"
Name="DisplaySFMFileContents"
Text="{Binding Path=VManageLogFile}"
ScrollViewer.VerticalScrollBarVisibility="Au开发者_StackOverflowto"
>
<toolkit:RichTextBox.TextFormatter>
<toolkit:PlainTextFormatter />
</toolkit:RichTextBox.TextFormatter>
</toolkit:RichTextBox>
</TabItem>
<TabItem Header=" Headers" />
</TabControl>
</UserControl>
It just formats the lines to be as width of the window and not how they should be . Any idea ?
You need to set the WordWrap = False in order for this to work properly. Otherwise it will wrap the text and only show the Vertical scrollbar if needed.
In looking over the code in my text project, it looks like the WordWrap keyword might not be there. However, to enable this functionality, you can set the Document.PageWidth = and it will prevent the text from wrapping.
精彩评论