简体   繁体   中英

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

I know it's pretty easy with windows forms but I have to use a wpf application so it's probably harder as I can't seem to find anything. Thanks

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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM