Created
October 16, 2009 01:57
-
-
Save khigia/211473 to your computer and use it in GitHub Desktop.
C# NumericUpDown MouseWheel event
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyNumericUpDown : NumericUpDown | |
{ | |
protected override void OnMouseWheel (MouseEventArgs e) | |
{ | |
// remove scrolllines scaling, taking care of case scrolllines is 0 | |
int delta = e.Delta / Math.Max (Math.Abs (SystemInformation.MouseWheelScrollLines), 1); | |
base.OnMouseWheel (new MouseEventArgs (e.Button, e.Clicks, e.X, e.Y, delta)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fixes increment of NumericUpDown being 3 instead of 1.
Thanks.