NumUpDown bug?

jeterry

Member
Licensed User
Longtime User
The attached program and Sqlite data give me different results on the desktop and device.

The number that should be loaded into the numupdwn value is 33183. Works fine on desktop and a device with Mobile 5. Does not work on pc2003 device.

Checked the Netcf on the 2003 device, using Erel's netcf test program and it indicates Net Framewok 2.0 2.0.7045.0 is installed.

Is this a bug in NetCf 2 or what?

Thanks
 

agraham

Expert
Licensed User
Longtime User
The problem is that on the Compact Framework a NumericUpDown control holds it's values as an Int16. This means that the values it can hold only range from negative 32768 through positive 32767. As your expected value of 33183 is larger than the maximum it is being interpreted as a negative number and is being adjusted to the value of the Minimum property of the NumericUpDown.

As this is a Compact Framework limitation WM5.0 should also exhibit this behaviour as the CF is independent of the OS. Both my WM2003SE Axim X30 and my WM6.0 iPAQ 214 do show this problem so I would expect a WM5.0 device to show it. Perhaps you didn't try an out of range value.
 
Last edited:

jeterry

Member
Licensed User
Longtime User
Works find under Mobile 5, using Net Frame 2.0 3.57283.0., per Erel test program. Mobile 5 is running on a IPAQ hx2790b

Screen shot is below. The current value of the next invoice is shown correctly.

I also tested the min (30000) and max (39999) values and they worked. Wouldn't allow anything less than the min value or greater than the max value.

Thanks
 

agraham

Expert
Licensed User
Longtime User
It looks as though you are entering the values manually as I can see a cursor in the screen shot. Yes it appears to work properly for manual entry but if you read the Value property back you will find it is negative for out of range values. Enter 39999 and it will read back as -25537! Similarly assigning to the Value property will not work. It appears that the manual entry validation is correctly using a reasonable resolution but the actual storage of the Value is being done as an Int16. This is a known limitation of the CF NumericUpDown control.
 
Top