Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I add a scrollbar to a textbox in wpf c#

Tags:

c#

wpf

textbox

How does one get scrollbars on a TextBox?

like image 334
John Douglas Avatar asked Apr 20 '16 23:04

John Douglas


1 Answers

The HorizontalScrollBarVisibility and VerticalScrollBarVisibility properties are used to set horizontal and vertical scroll bars of a TextBox, The ScrollBarVisibility enumeration has four values – Disabled, Auto, Hidden, and Visible.

<TextBox Name="TextBox"
         Width="300" Height="150"
         HorizontalScrollBarVisibility="Visible"
         VerticalScrollBarVisibility="Visible"
         TextWrapping="Wrap" >           
</TextBox>
like image 118
Nejc Galof Avatar answered Sep 28 '22 14:09

Nejc Galof