(note: I'm using .NET 2.0)
If there is no text (and .Value has already been called) in my
NumericUpDown, I cannot set its property Value.

Demo:
- run the little attached program.
- press the button
- delete the value in the NumericUpDown
- press the button again: the text (of the NumericUpDown) is NOT updated!!!

Does anyone know a workaround this problem?

Re: NumericUpDown problem by Stoitcho

Stoitcho
Fri Feb 03 08:21:11 CST 2006

Lloyd,

There is no attached project, anyways it is not a good idea to post
attachements in the ng.

I tried to add NumericUpDown control to a from. I pressed the button it
increased the value. I delete the value in the edit box and pressed the
button again it new increased value showed up.

If this is the situation in your project my best guess is that you do
something else in the code.


--

Stoitcho Goutsev (100)
"Lloyd Dupont" <net.galador@ld> wrote in message
news:eJBM5bKKGHA.3944@tk2msftngp13.phx.gbl...
> (note: I'm using .NET 2.0)
> If there is no text (and .Value has already been called) in my
> NumericUpDown, I cannot set its property Value.
>
> Demo:
> - run the little attached program.
> - press the button
> - delete the value in the NumericUpDown
> - press the button again: the text (of the NumericUpDown) is NOT
> updated!!!
>
> Does anyone know a workaround this problem?
>



Re: NumericUpDown problem by Lloyd

Lloyd
Fri Feb 03 18:15:22 CST 2006

Sorry, I forgot to attach it.
I don't see what the problem with a 500 bytes attached document, could you
explain it to me?
See for your self, there is no extra code, the NumericUpDown doesn't work as
described!
Or maybe only with 2.0 :-(

When I say press the button I mean an extra real (SWF.)Button (not one of
the 2 up/down button)
(and this button has a handler to set the .Value ot the NumericUpDown)

"Stoitcho Goutsev (100)" <100@100.com> wrote in message
news:eoRPuyMKGHA.3164@TK2MSFTNGP11.phx.gbl...
> Lloyd,
>
> There is no attached project, anyways it is not a good idea to post
> attachements in the ng.
>
> I tried to add NumericUpDown control to a from. I pressed the button it
> increased the value. I delete the value in the edit box and pressed the
> button again it new increased value showed up.
>
> If this is the situation in your project my best guess is that you do
> something else in the code.
>
>
> --
>
> Stoitcho Goutsev (100)
> "Lloyd Dupont" <net.galador@ld> wrote in message
> news:eJBM5bKKGHA.3944@tk2msftngp13.phx.gbl...
>> (note: I'm using .NET 2.0)
>> If there is no text (and .Value has already been called) in my
>> NumericUpDown, I cannot set its property Value.
>>
>> Demo:
>> - run the little attached program.
>> - press the button
>> - delete the value in the NumericUpDown
>> - press the button again: the text (of the NumericUpDown) is NOT
>> updated!!!
>>
>> Does anyone know a workaround this problem?
>>
>
>


begin 666 TW.cs
M=7-I;F<@4WES=&5M+E=I;F1O=W,N1F]R;7,[#0IU<VEN9R!3>7-T96TN1')A
M=VEN9SL-"G5S:6YG(%-Y<W1E;3L-"@T*#0HO+R!C<V,@+VYO;&]G;R!45RYC
M<R F)B!45PT*8VQA<W,@3E5$4 T*>PT*"7!U8FQI8R!S=&%T:6,@=F]I9"!-
M86EN*"D-"@E[#0H)"4%P<&QI8V%T:6]N+E)U;BA#<F5A=&4H*2D["0T*"7T-
M"@T*"7-T871I8R!.=6UE<FEC57!$;W=N(&YU;3L-"@ES=&%T:6,@1F]R;2!#
M<F5A=&4H*0T*"7L-"@D)1F]R;2!F(#T@;F5W($9O<FTH*3L-"@T*"0EN=6T@
M/2!N97<@3G5M97)I8U5P1&]W;B@I.PT*"0EN=6TN4&%R96YT(#T@9CL-"@D)
M;G5M+E9A;'5E(#T@,3@[#0H)#0H)"4)U='1O;B!B=70@/2!N97<@0G5T=&]N
M*"D[#0H)"6)U="Y,;V-A=&EO;B ](&YE=R!0;VEN="@S,"P@,S I.PT*"0EB
M=70N4&%R96YT(#T@9CL-"@D)8G5T+D-L:6-K("L](&YE=R!%=F5N=$AA;F1L
M97(H2$-L:6-K*3L-"@D-"@D)<F5T=7)N(&8[#0H)?0T*"7-T871I8R!V;VED
M($A#;&EC:RAO8FIE8W0@;RP@179E;G1!<F=S(&4I#0H)>PT*"0EN=6TN5F%L
/=64@/2 T,CL-"@E]#0I]
`
end


Re: NumericUpDown problem by SP

SP
Sat Feb 04 23:09:54 CST 2006


"Lloyd Dupont" <net.galador@ld> wrote in message
news:eJBM5bKKGHA.3944@tk2msftngp13.phx.gbl...
> (note: I'm using .NET 2.0)
> If there is no text (and .Value has already been called) in my
> NumericUpDown, I cannot set its property Value.
>
> Demo:
> - run the little attached program.
> - press the button
> - delete the value in the NumericUpDown
> - press the button again: the text (of the NumericUpDown) is NOT
> updated!!!
>
> Does anyone know a workaround this problem?

Num.Text = num.Value.ToString() works.

After you delete the 42 the Value property remains the same probably because
no entry is not a number so the 42 remains as the Value. This gives you the
chance to get the value before it was deleted. Because you are not changing
the Value when you set it to 42 the second time then the control is not
calling it's internal methods to cause the value to display as nothing has
really changed. You need to decide what "no entry" means in terms of a
numerical value and set the control's Text property to what you want
displayed, i.e. either 0 or to the Value.ToString(). Generally most controls
show 0 when you leave the control empty.

HTH

SP



Re: NumericUpDown problem by Lloyd

Lloyd
Sun Feb 05 04:31:37 CST 2006

funny that, when I try to type num.Text, the property Text doesn't appears
in VS.NET.
Somehow I imagined they used some kind of weird trick to make it
unavailable...
silly me, of course it compiles!

Thanks SP!

"SP" <ecneserpegats@hotmail.com> wrote in message
news:%23TB7nHhKGHA.3996@TK2MSFTNGP10.phx.gbl...
>
> "Lloyd Dupont" <net.galador@ld> wrote in message
> news:eJBM5bKKGHA.3944@tk2msftngp13.phx.gbl...
>> (note: I'm using .NET 2.0)
>> If there is no text (and .Value has already been called) in my
>> NumericUpDown, I cannot set its property Value.
>>
>> Demo:
>> - run the little attached program.
>> - press the button
>> - delete the value in the NumericUpDown
>> - press the button again: the text (of the NumericUpDown) is NOT
>> updated!!!
>>
>> Does anyone know a workaround this problem?
>
> Num.Text = num.Value.ToString() works.
>
> After you delete the 42 the Value property remains the same probably
> because no entry is not a number so the 42 remains as the Value. This
> gives you the chance to get the value before it was deleted. Because you
> are not changing the Value when you set it to 42 the second time then the
> control is not calling it's internal methods to cause the value to display
> as nothing has really changed. You need to decide what "no entry" means in
> terms of a numerical value and set the control's Text property to what you
> want displayed, i.e. either 0 or to the Value.ToString(). Generally most
> controls show 0 when you leave the control empty.
>
> HTH
>
> SP
>