Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

NumericUpDown.Value cannot be > 2^16

7 views
Skip to first unread message

Steve B.

unread,
Nov 2, 2005, 4:17:10 AM11/2/05
to
Hi,

I've a strange behaviour on the numericupdown control.

Althought it property "Value" is decimal type, the value cannot be > 2^16.
If the value is greater, it becomes 0.

Here is a sample code that illustrate this :

this.numericUpDown1.Maximum = 1000000;

this.numericUpDown1.Value = 10000; // < 2^16

MessageBox.Show(

this.numericUpDown1.Value.ToString() // Show 10000

);

this.numericUpDown1.Value = 100000;// > 2^16

MessageBox.Show(

this.numericUpDown1.Value.ToString() // Show 0

);

Is there any knowledge about this ?

Thanks,

Steve


Ilya Tumanov [MS]

unread,
Nov 2, 2005, 3:18:38 PM11/2/05
to
http://groups.google.com/group/microsoft.public.dotnet.framework.compactframework/browse_frm/thread/7f6f91408808f034/aff8cf0a10bb3562?q=UpDown+control&rnum=8&hl=en#aff8cf0a10bb3562


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).

"Steve B." <steve_...@com.msn.swap_com_and_msn> wrote in message
news:OXZ11443...@tk2msftngp13.phx.gbl...

Konrad

unread,
Nov 4, 2005, 5:33:44 AM11/4/05
to
Użytkownik Steve B. napisał:

> Hi,
>
> I've a strange behaviour on the numericupdown control.
>
> Althought it property "Value" is decimal type, the value cannot be > 2^16.
> If the value is greater, it becomes 0.
>

Try

MessageBox.Show(numericUpDown1.Text);

and

x = Decimal.Parse(numericUpDown1.Text);


Konrad.

Steve B.

unread,
Nov 4, 2005, 6:32:50 AM11/4/05
to
??


"Konrad" <x...@xxx.pl> a écrit dans le message de news:
dkfdei$40d$1...@atlantis.news.tpi.pl...

Konrad

unread,
Nov 4, 2005, 9:04:45 AM11/4/05
to

> ??

:-)

Use Text property, not Value.
For me it's working:

// set maximum on 3,000,000
numericUpDown1.Maximum = 3000000;

// set 1,000,001
numericUpDown1.Text = "1000001";

// double it
numericUpDown1.Text = String.Format("{0}",
Decimal.Parse(numericUpDown1.Text) * 2);

// And you will get 2,000,002
MessageBox.Show(numericUpDown1.Text);

Konrad.

0 new messages