Scrollbar / ScrollViewer disable AutoHide #1725
-
Hi, I'm using the ScrollViewer / Scrollbar on many places in my app. Is there any way to disable the hover feature and use directly the wider Scrollviewer? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I have found an solution by myself. In my Project I added an folder called "Styles". In this folder I added an Ressource Dictionary called "CustomScrollbar.xaml". In the App.xaml I have added this line in the section "<ResourceDictionary.MergedDictionaries>": In the MainWindow.xaml I had already an ScrollViewer. In the XAML-Designer I searched the "Style" component. In the Rightclick context menu I used the function "Convert in a new ressource" and set the name to "ScrollViewerCustom" and defined it in the "CustomScrollBar.xaml". Then in the file "CustomScrollBar.xaml" appeared many styles regarding the scrollviewer. After I understand what they are used for I removed all the ControlTemplate.Ressources section which contained only the StoryBoard sections. And I removed the corresponding Storyboard Triggers in the ControlTemplate.Triggers section. Furthermore I removed the autohide Scrollviewer Template and the corresponding Trigger. This is my final "CustomScrollBar.xaml", if anyone is interested:
With this the Scrollviewer is always 7 pixels wide and you don't have to hover it, to get wide enough to be able to scroll with the mouse cursor. |
Beta Was this translation helpful? Give feedback.
I have found an solution by myself.
In my Project I added an folder called "Styles". In this folder I added an Ressource Dictionary called "CustomScrollbar.xaml".
In the App.xaml I have added this line in the section "<ResourceDictionary.MergedDictionaries>":
In the MainWindow.xaml I had already an ScrollViewer. In the XAML-Designer I searched the "Style" component. In the Rightclick context menu I used the function "Convert in a new ressource" and set the name to "ScrollViewerCustom" and defined it in the "CustomScrollBar.xaml".
Then in the file "CustomScrollBar.xaml" appeared many styles regarding the scrollviewer.
I checked trough the code and got many StoryBoard errors.
After I under…