[Mono-bugs] [Bug 409026] New: NumberUpDown: should change invalid value to boundary

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Jul 14 15:19:07 EDT 2008


https://bugzilla.novell.com/show_bug.cgi?id=409026


           Summary: NumberUpDown: should change invalid value to boundary
           Product: Mono: Class Libraries
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Windows.Forms
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: andyhume32 at yahoo.co.uk
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


When a value is typed into a NumberUpDown and the value is out of bounds it
should be changed to the respective limit.  Currently the new value is just
discarded.

Repro
1. Run PropGridFormControlsTabView.
2. Select the NumberUpDown tab.
3. Type in the value 110, hit Return key, or click away etc.
Expect the value to become 100.
4. Type the value -5.
Expect the value to become 0.


The following patch fixes this.
[[
Index: NumericUpDown.cs
===================================================================
--- NumericUpDown.cs    (revision 106623)
+++ NumericUpDown.cs    (working copy)
@@ -376,7 +376,7 @@
                protected void ParseEditText () {
                        try {
                                if (!hexadecimal) {
-                                       Value = decimal.Parse (Text,
CultureInfo.CurrentCulture);
+                                       Value = Check (decimal.Parse (Text,
CultureInfo.CurrentCulture));
                                } else {
#if !NET_2_0
                                        Value = Check (Convert.ToDecimal
(Convert.ToInt32 (Text, 16)));
]]


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list