This project is read-only.
1
Vote

Mouse Wheel scrolling does not work for me with SourceGrid 4.40

description

Mouse wheel scrolling does not work at all for me - after inheriting from sourcegrid and stepping into the event handler, I noticed that in CustomScrollControl.CustomScrollWheel there's a threshold of 120 for the mouse delta - but my event only ever has a delta of 30.
I think that you should accumulate the delta instead of just discarding values you consider to small.

In my inherited class, this override fixes the problem for me:
    protected override void OnMouseWheel(System.Windows.Forms.MouseEventArgs e)
    {
        mAccumulatedDelta += e.Delta;
        if (Math.Abs(mAccumulatedDelta) >= 120)
        {
            base.OnMouseWheel(new System.Windows.Forms.MouseEventArgs(e.Button, e.Clicks, e.X, e.Y, mAccumulatedDelta));
            mAccumulatedDelta = 0;
        }
        else
        {
            base.OnMouseWheel(e);
        }
    }

comments