[WPF] How to change the width of a Scrollbar (Scrollviewer)

If you are programming applications which should be used on a touch screen then you may have encountered the problem that it is tricky to use the scrollbar with the finger.
Because the default scrollbar is to small.

If you want to adjust the width of all scrollbars in your application you can put this piece of code into you resources

        <Style x:Key="{x:Type ScrollBar}" TargetType="{x:Type ScrollBar}">          
                <Setter Property="MinWidth" Value="35" />
                <Setter Property="Width" Value="35" />
        </Style>
Advertisements
  1. Your solution will work for a vertical scrollbar but will not display the horizontal scrollbar correctly. Here is some XAML that works a bit better.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: