I am trying to load a Rich Text Format (RTF) file into a WPF RichTextBox. When I perform the load, it appears as though the file is getting loaded into the RichTextBox but the scroll bar is displayed without a visible slider box to scroll download. The scrollbar does not show the bottom arrow so it appears the bottom of the scrollbar is below the display area for the RichTextBox. This prevents a user from being able to scroll downward. I believe I am either missing a XAML property for the RichTextBox or something is not right with the way I am loading the RTF file. Please help. Thanks in advance.
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Grid.RowSpan="5"
Grid.Column="0" Grid.ColumnSpan="3"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<RichTextBox x:Name="LicenseRichTextBox" Margin="10"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
IsReadOnly="True" VerticalScrollBarVisibility="Visible">
</RichTextBox>
</StackPanel>
<StackPanel Grid.Row="6" Grid.Column="1" Grid.ColumnSpan="3" Margin="65,20,0,0" >
<Button x:Name="CloseButton" HorizontalAlignment="Left"
Width="90" Margin="-10,0,0,0"
Click="CloseButton_Click">
<StackPanel Orientation="Horizontal">
<Image Source="{StaticResource CloseButtonImageKey}"
Margin="5,0,0,0" Height="20" Width="20" />
<TextBlock Padding="5,0,0,0" VerticalAlignment="Center"><Run Text="Close"/></TextBlock>
</StackPanel>
</Button>
</StackPanel>
</Grid>
public void LoadRTF()
{
const string EULA_Dir = @"Resources\EULA\EUlA.RTF";
string currentDir = AppDomain.CurrentDomain.BaseDirectory;
string PathToEULA = currentDir + EULA_Dir;
if (File.Exists(PathToEULA))
{
LicenseRichTextBox.Selection.Load(new FileStream(PathToEULA, FileMode.Open), DataFormats.Rtf);
}
else
{
MessageBox.Show("Unable to locate the following file " + PathToEULA);
}
}