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" />

Share:

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

In this post, you’ll learn about the error message “WorkbookNotSupported – The file you selected cannot be opened because it...
  • .NET
  • December 17, 2022
In this post, you’ll learn about the error message “SpecifiedRangeNotFound – The requested range does not exist in the sheet.”...
  • .NET
  • December 17, 2022
In this post, you’ll learn about the error message “SheetRangeMismatch – The sheet provided as the sheet argument is not...
  • .NET
  • December 17, 2022