force normal scroll bars

John Torjo 861 Reputation points
2020-06-04T13:36:20.693+00:00

How do I force the scroll bars to be ALWAYS SHOWN?

That little small line shown where you need to actually go there, and then it's shown and then it gets hidden - I don't know who came up with it, but clearly did not ask us, the developers, if we want it. No one wants that - IT'S CONFUSING.

I want a normal scroll bar that is always shown. How do i do that?

Universal Windows Platform (UWP)
{count} votes

Accepted answer
  1. Daniele 1,996 Reputation points
    2020-06-07T14:15:27.55+00:00

    I modified the default ScrollBar style starting from the one for version 10.0.17763.0, and created a resource dictionary attached here ScrollBarStyleDictionary.xaml.txt (rename in .xaml).

    You can use it as Resource in the Control where you want classic ScrollBars or globally in your Application.Resources.

    As example I added the XAML snippet below. In a 2x2 Grid the first row has 2 ScrollViewers and the second has 2 ListView. On both ScrollViewer and ListView in the first column I added the ScrollBarStyleDictionary.xaml and they always show the ScrollBars.

       <Grid ColumnSpacing="8" RowSpacing="8">  
           <Grid.RowDefinitions>  
               <RowDefinition Height="*"/>  
               <RowDefinition Height="*"/>  
           </Grid.RowDefinitions>  
           <Grid.ColumnDefinitions>  
               <ColumnDefinition Width="*"/>  
               <ColumnDefinition Width="*"/>  
           </Grid.ColumnDefinitions>  
           <ScrollViewer Grid.Row="0" Grid.Column="0" HorizontalScrollBarVisibility="Visible">  
               <ScrollViewer.Resources>  
                   <ResourceDictionary Source="ScrollBarStyleDictionary.xaml"/>  
               </ScrollViewer.Resources>  
               <Rectangle Width="1000" Height="1000">  
                   <Rectangle.Fill>  
                       <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">  
                           <GradientStop Color="Aqua" Offset="0"/>  
                           <GradientStop Color="GreenYellow" Offset="0.5"/>  
                           <GradientStop Color="Red" Offset="1"/>  
                       </LinearGradientBrush>  
                   </Rectangle.Fill>  
               </Rectangle>  
           </ScrollViewer>  
           <ScrollViewer Grid.Row="0" Grid.Column="1" HorizontalScrollBarVisibility="Auto">  
               <Rectangle Width="1000" Height="1000">  
                   <Rectangle.Fill>  
                       <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">  
                           <GradientStop Color="Aqua" Offset="0"/>  
                           <GradientStop Color="GreenYellow" Offset="0.5"/>  
                           <GradientStop Color="Red" Offset="1"/>  
                       </LinearGradientBrush>  
                   </Rectangle.Fill>  
               </Rectangle>  
           </ScrollViewer>  
           <ListView Grid.Row="1" Grid.Column="0" ItemsSource="{x:Bind _items}">  
               <ListView.Resources>  
                   <ResourceDictionary Source="ScrollBarStyleDictionary.xaml"/>  
               </ListView.Resources>  
           </ListView>  
           <ListView Grid.Row="1" Grid.Column="1" ItemsSource="{x:Bind _items}"/>  
       </Grid>  
    

    If you want to change the size of a ScrollBars add this "<x:Double x:Key="ScrollBarSize">16</x:Double>" to Application.Resources (global) or specific control Resources.

    Let me know, happy to help.


3 additional answers

Sort by: Most helpful
  1. Matt Lacey 791 Reputation points MVP
    2020-06-04T14:22:07.143+00:00

    Depending on the control that contains the scroll bars, you can set ScrollViewer.VerticalScrollBarVisibility="Visible" so that the scroll indicator is always shown.
    If you want a traditional Win32/ComCtrl style wide scroll bar always visible, you may need to restyle the control and/or add a ScrollBar control where you want it shown.

    The default visuals of the default controls are the standard for Windows10. If you want something beyond the default conventions for the platform you'll have to modify as per your requirements.


  2. Daniele 1,996 Reputation points
    2020-06-06T10:04:11.847+00:00

    If you go to Settings > Ease of Access > Display > Automatically hide scroll bars in Windows and set the switch to Off the scroll bars will be visible as the classic one. Can this per user configuration answer to your request?


  3. John Torjo 861 Reputation points
    2020-06-07T09:04:43.153+00:00

    I like this modern app bars and I like that there is a setting that allow users to choose preferred behavior, just my opinion.

    Yeah, I'm quite sure you are in the minority. People struggle with the "modern" scrollbars when they actually need to use them. This is just one more of those great "mobile first" things no one wants. But you guys don't seem to care about this and still consider them a good thing to have.

    Please show me where in Davinci Resolve, Adobe products, etc. - any decent enterprise app do they use these "modern" scrollbars.

    I think is not possible that an app programmatically changes setting "Settings > Ease of Access > Display > Automatically hide scroll bars in Windows", as it affect all the system.

    I would be fine with that, if this was the default.

    About the last point, I made some experiment working on the ScrollBar style, but still nothing good to post here. I will if I find a working solution.

    Yes, please. Thanks!

    EDIT: I tried to delete this when I realized I mistakenly posted at as an answer, but then I could not enter the same thing as a comment. This forum is just amazing.

    0 comments No comments