reach4thelasers
reach4thelasers

Reputation: 26909

WPF Slider Control Mouse Wheel

I've got a WPF Slider, the Mousewheel Eventhandler is all wired up and its working fine, However, the area of the slider where the mouse wheel takes effect is very very narrow and I need to have my mouse right over the slider rail - which is about 5 pixels.

How can I increase the area of influence for mousewheel activation?

UPDATE:

Btw I need to do it in code, I don't have access to Xaml as I am adding something to a third party application.

UPDATE 2:

Here's my code for creating the slider:

        var riskRewardSlider = new Slider()
        {
            Minimum = 1,
            Maximum = 5,
            SmallChange = 0.5,
            TickFrequency = 0.5,
            DataContext = scopeContext,
            IsSnapToTickEnabled = true, 
            Value = 2,
            Background = Brushes.DodgerBlue,
            Height = 30,
            IsSelectionRangeEnabled = true
        };

Upvotes: 0

Views: 1317

Answers (1)

GBursali
GBursali

Reputation: 363

Slider value is changes with doubles. It count 0.1 or less sensitive about that.If i understand correctly,you don't want to increase like 0,1. So;

mySlider.IsSnapToTickEnabled = true;
mySlider.TickFrequency = 1;

You can add that on your starting method. (or you can add this on your xaml as attributes, but you want as code). This makes your slider increase by 1, instead of 0,1.

Note: That 0,1 is just an double example, Slider's less sensitive than 0,1 by default.

Note2: Sorry for my bad English.

Upvotes: 1

Related Questions