[ACCEPTED]-Mousewheel Delta value always 120-mousewheel

Accepted answer
Score: 12

You should be able to handle the PreviewMouseWheel event. The 3 delta for each event will be +/-120, but 2 you will get one event for each "notch" of 1 the wheel.

Score: 0

John Myczek gave the basically right answser. I 6 should add that if you turn the wheel fast 5 enough, you will notice that the delta is 4 lager than 120 or smaller than -120. It 3 will be a multiples of +/-120. So you'd 2 better do some division in the handle of 1 PreviewMouseWheel event.

Score: 0

The above statements about the value always being +/-120 are not always 5 correct.

If you rotate the wheel slowly, the value 4 is indeed +/-120, but than, if you rotate 3 the wheel fast, the value becomes +/-240.

I'm 2 guessing that there may be other values too (haven't tested 1 it, yet)...

Score: 0
    private int step = 0;
    protected override void OnMouseWheel(MouseEventArgs e)
    {
        base.OnMouseMove(e);
     
        if(e.Delta>0)
                step++;
        else if(e.Delta<0)
            step--;
        this.Text = "Step:-" + step.ToString();
        
    }

0

More Related questions