Skip to content

How to Autohide the scroll bar of the list box in WPF? #7803

Answered by miloush
VahidEra asked this question in Q&A
Discussion options

You must be logged in to vote

First of all, there is an accessibility settings in Windows to always show scrollbars and you should respect that if you are implementing this yourself.

An easy way is to set ScrollViewer.VerticalScrollBarVisibility to Auto on MouseEnter and to Hidden on MouseLeave. However, in the default template, this will change the width of the content as the scrollbar appears and disappears. You might need to change the template of the scrollviewer for the scrollbar to be overlaid on top of the content rather than to be to its side.

However, doesn't the material design already support this in their listboxes?

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@VahidEra
Comment options

@miloush
Comment options

@VahidEra
Comment options

Answer selected by VahidEra
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants