Is there a way to create a ScrollViewer which only allows content to scroll vertically? The horizontal (width) must be constrained in the same manner as a StackPanel's width is constrained to its parent (when HorizontalAlignment=Stretch).
I have a resizable window which contains content I want to allow to scroll vertically. The window contains a ScrollViewer. Inside there is a lot of TextBoxs (a data entry form). When I type lots of text in a TextBox, the control just keeps growing to the right, and off the window. If I use a StackPanel instead of a ScrollViewer, then the size of the TextBox remains the same no matter how much text is in there. (but then no vertical scrolling).
I cant set a hard-coded Width because the window is resizable.
So basically I want to constrain the ScrollViewer from growing in the Horizontal direction.
Thanks
Try setting
<ScrollViewer HorizontalScrollBarVisibility="Disabled">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With