Reputation: 2824
I'm trying to set vertical scrollbar in RichEditBox always visible. It seems that ScrollViewer
attached properties should do the trick, but nothing happens, scrollbar still invisible.
Here is markup:
<ScrollViewer Grid.Row="2">
<RichEditBox
Margin="10"
AcceptsReturn="True"
PlaceholderText="Enter comments here"
TextWrapping="Wrap"
Height="140"
ScrollViewer.IsVerticalRailEnabled="True"
ScrollViewer.VerticalScrollMode="Enabled"
ScrollViewer.VerticalScrollBarVisibility="Visible"/>
</ScrollViewer>
So, why does scrollbar is not showing up and how to make it visible?
Upvotes: 0
Views: 401
Reputation: 2387
You are setting the property values for the scroll viewer that lives inside the RichEditBox Template, but you are also surrounding the RichEditBox with another ScrollViewer.
You have two options:
As shown here:
<ScrollViewer Grid.Row="2" IsVerticalRailEnabled="True" VerticalScrollMode="Enabled" VerticalScrollBarVisibility="Visible">
<RichEditBox
Margin="10"
AcceptsReturn="True"
PlaceholderText="Enter comments here"
TextWrapping="Wrap"
Height="140"/>
</ScrollViewer>
Upvotes: 1