Help me, problem with NumericUpDown.Value

  • Thread starter Thread starter Beorne
  • Start date Start date
B

Beorne

I'm on compact framework on WinCE

the code

----------------------------------------------------
// Par.Offset == 75000 and is an int

decimal pippo = Par.Offset;
// now pippo == 75000

numericUpDownOffset.Value = pippo;
// now numericUpDownOffset.Value == 9464
----------------------------------------------------

Why?????
numericUpDownOffset.Maximum = 1000000000
numericUpDownOffset.Minimum = 0
numericUpDownOffset.Increment = 1

Is it a bug?
 
I don't know what this numericUpDownOffset.Value is, but you should
check it is an signed int32...

if you put an signed value into an unsigned, it could freak like the
way you are describing...
 
No, it's not a bug. On NETCF numeric up/down control is limited to signed 16
bit value since underlying native control is limited to this range.

75000 is outside the range and thus truncated: 75000=124F8h=>24F8h=9464


--
Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.

*** Want to find answers instantly? Here's how... ***

1. Go to
http://groups-beta.google.com/group/microsoft.public.dotnet.framework.compactframework?hl=en
2. Type your question in the text box near "Search this group" button.
3. Hit "Search this group" button.
4. Read answer(s).
 
I ran on this issue yesterday. Can you tell me, why you refuse to call
it bug? If it's a "feature" (as MS usually says), why does the Value
property has decimal and not int16 type?? This is really confusing and
unprofessional :(((


Ilya Tumanov [MS] napsal:
 
its not a bug because it does exactly what it should do. "Why did they
make it a int16?" is a good question indeed, but its just not a bug. I
think they will change it in the next netcf

..net 3.0
http://windowssdk.msdn.microsoft.com/en-us/library/system.windows.forms.numericupdown.aspx

and maybe this can help you out:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=610159&SiteID=1



Buthrakaur schreef:
I ran on this issue yesterday. Can you tell me, why you refuse to call
it bug? If it's a "feature" (as MS usually says), why does the Value
property has decimal and not int16 type?? This is really confusing and
unprofessional :(((


Ilya Tumanov [MS] napsal:
No, it's not a bug. On NETCF numeric up/down control is limited to signed 16
bit value since underlying native control is limited to this range.

75000 is outside the range and thus truncated: 75000=124F8h=>24F8h=9464


--
Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.

*** Want to find answers instantly? Here's how... ***

1. Go to
http://groups-beta.google.com/group/microsoft.public.dotnet.framework.compactframework?hl=en
2. Type your question in the text box near "Search this group" button.
3. Hit "Search this group" button.
4. Read answer(s).
 
Back
Top