How to Show Automatic Vertical Scroll bar in WPF TextBlock?

There are times where you want to show automatic scroll bar in a WPF TextBlock and you can easily achieve it by wrapping the TextBlock in a scroll viewer.

How to Show Automatic Vertical Scroll bar in WPF TextBlock?

<ScrollViewer>
    <TextBlock />
</ScrollViewer>

How to Show Automatic Vertical Scroll bar in WPF TextBox?

If you have a TextBox and wish to scroll bars in a TextBox , then you can use the ScrollViewer attached properties as shown below.

<TextBox ScrollViewer.HorizontalScrollBarVisibility="Disabled"
         ScrollViewer.VerticalScrollBarVisibility="Auto" />
Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Hey, wait!Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.