[Mono-bugs] [Bug 80166][Cos] New - Using the mouse wheel on a NumericUpDown

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Wed Dec 6 09:29:36 EST 2006


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by georgegiolfan at yahoo.com.

http://bugzilla.ximian.com/show_bug.cgi?id=80166

--- shadow/80166	2006-12-06 09:29:36.000000000 -0500
+++ shadow/80166.tmp.4126	2006-12-06 09:29:36.000000000 -0500
@@ -0,0 +1,74 @@
+Bug#: 80166
+Product: Mono: Class Libraries
+Version: 1.2
+OS: Windows XP
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Cosmetic
+Component: Windows.Forms
+AssignedTo: toshok at ximian.com                            
+ReportedBy: georgegiolfan at yahoo.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Using the mouse wheel on a NumericUpDown
+
+Description of Problem:
+Using the mouse wheel on a NumericUpDown seems to modify Value by 2 * 
+Increment. Microsoft .NET Framework seems to use the product of Increment 
+and the number of lines specified on the Wheel tab of the Mouse properties 
+page in Control Panel.
+
+Steps to reproduce the problem:
+1. Compile and run the following program.
+using System.Windows.Forms;
+class TestForm : Form {
+    static void Main() {
+        Application.Run(new TestForm());
+    }
+    public TestForm() {
+        NumericUpDown NumericUpDown = new NumericUpDown();
+        NumericUpDown.Increment = 10;
+        Controls.Add(NumericUpDown);
+    }
+}
+2. Use the mouse wheel.
+
+Actual Results:
+The value is modified by 20 (2 * Increment), which is strange, because 
+this code seems to try to prevent that (in the UpDownBase class):
+
+		protected override void OnMouseWheel(MouseEventArgs e) {
+			// prevent this event from firing twice for the same 
+mouse action!
+			if (GetChildAtPoint(new Point(e.X, e.Y)) == null)
+				txtView_MouseWheel(null, e);
+		}
+
+Expected Results:
+The value is modified as in Microsoft .NET Framework or at least by 30 (3 
+* Increment) as Theme.MouseWheelScrollLines is currently hardcoded to 
+return 3.
+
+How often does this happen? 
+Always.
+
+Additional Information:
+I think the value of SystemInformation.MouseWheelScrollLines should be 
+used, possibly like this (in the NumericUpDown class) :
+		public override void UpButton() {
+			if (UserEdit)
+				ParseEditText();
+
+			Value = Math.Min(maximum, unchecked(dvalue + increment * 
+SystemInformation.MouseWheelScrollLines));
+		}
+(the same for DownButton)
+
+You may find useful information about implementing 
+SystemInformation.MouseWheelScrollLines on Windows here:
+http://msdn2.microsoft.com/en-us/library/
+ms645602.aspx#retrieving_wheel_scroll


More information about the mono-bugs mailing list