ScrollViewer visibility bug in TextBox control
See original GitHub issueDescription
The property VerticalScrollBarVisibility of the TextBox control doesn’t work as expected. Setting such property to Visible does not reveal the vertical scrollbar. Instead, it works like setting the property to Auto. So, for example, it is not possible to mimic Notepad interface where the vertical scrollbar is visible, but disabled, when there is a short amount of text.
Steps to Reproduce
- Create a new WPF .Net Core app.
- Add a Textbox to the Grid in
MainWindow.xamland set its propertyVerticalScrollBarVisibilitytoVisible. - Add the ModernWpf library to the project and then add
<ui:XamlControlsResources />inApp.xaml. - Run the app.
Expected Behavior
The vertical scrollbar should be shown disabled if there is a short amount of text and it will be enabled when needed.
Actual Behavior
The vertical scrollbar is hidden and doesn’t show up until needed.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Stop TextBox in ScrollViewer from growing with content
I have a ScrollViewer with HorizontalScrollBarVisibility set to "Auto" that contains a TextBox. The problem is that when a user enters text, ...
Read more >TextBox.VerticalScrollBarVisibility Property
Property Value. Type: System.Windows.Controls.ScrollBarVisibility. The visibility of the vertical scroll bar. The default is Hidden.
Read more >Implementing Scrolling in Windows using WPF ...
The Visible value makes sure the scrollbars are visible all the time regardless of the content needed scrolling or not. Let's add a...
Read more >How to set Scrollbar in TextBox in C#? - GeeksforGeeks
Visual Studio -> File -> New -> Project -> WindowsFormApp; Step 2: Drag the TextBox control from the ToolBox and Drop it on...
Read more >ARIA: scrollbar role - Accessibility - MDN Web Docs - Mozilla
A scrollbar is a range that controls what part of a viewport's content is currently visible in the viewport's frame; whether the viewport...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Below is how the same markup looks in WinUI. For a start I’ll try to make the behavior consistent with WinUI, although it also has its own issues.
ScrollViewer.VerticalScrollBarVisibilitydoesn’t work either. The other values work just fine. I also noticed that the same issue happens with the horizontal scrollbar.