473,387 Members | 1,530 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Getting the text in NumericUpDown

hi.
i have written this code to get the text in a NumericUpDown control:

nudQuestions.Text

and i start the application in debug mode and use the arrow keys that come
with the numeric up down control to set the number to be 2. but when i break
the process and view the value inside the control in Watch, it says that it
is "1".

how can i get its value correctly? thanks.

--
Xero

http://www.chezjeff.net
My personal web portal
Nov 21 '05 #1
5 3500
I think this is what you mean:

Private Sub NumericUpDown1_ValueChanged(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles NumericUpDown1.ValueChanged
TextBox1.Text = NumericUpDown1.Value
End Sub

When you break on the line 'NumericUpDown1.Value' the value won't increment
until you move to the next line of code. Therefore, your value will be 1
until the line of code below is reached because you've stopped it on the
line that hasn't executed yet

Crouchie1998
BA (HONS) MCP MCSE
Nov 21 '05 #2
Hi,

nudQuestions.value

Ken
--------------------
"Xero" <jeff_at_chezjeff_dot_net> wrote in message
news:86**********************************@microsof t.com...
hi.
i have written this code to get the text in a NumericUpDown control:

nudQuestions.Text

and i start the application in debug mode and use the arrow keys that come
with the numeric up down control to set the number to be 2. but when i
break
the process and view the value inside the control in Watch, it says that
it
is "1".

how can i get its value correctly? thanks.

--
Xero

http://www.chezjeff.net
My personal web portal

Nov 21 '05 #3
hi. thanks for replying.

i tried the code you gave me but the value now returns "1D" whatever the
number is.

what is wrong?

--
Xero

http://www.chezjeff.net
My personal web portal
"Ken Tucker [MVP]" wrote:
Hi,

nudQuestions.value

Ken
--------------------
"Xero" <jeff_at_chezjeff_dot_net> wrote in message
news:86**********************************@microsof t.com...
hi.
i have written this code to get the text in a NumericUpDown control:

nudQuestions.Text

and i start the application in debug mode and use the arrow keys that come
with the numeric up down control to set the number to be 2. but when i
break
the process and view the value inside the control in Watch, it says that
it
is "1".

how can i get its value correctly? thanks.

--
Xero

http://www.chezjeff.net
My personal web portal


Nov 21 '05 #4
Hi,

If you look at the nudQuestions.Value in the debugger it will show
1D for a value of 1. The D means it is of the decimal type.

Ken
-----------------
"Xero" <jeff_at_chezjeff_dot_net> wrote in message
news:1E**********************************@microsof t.com...
hi. thanks for replying.

i tried the code you gave me but the value now returns "1D" whatever the
number is.

what is wrong?

--
Xero

http://www.chezjeff.net
My personal web portal
"Ken Tucker [MVP]" wrote:
Hi,

nudQuestions.value

Ken
--------------------
"Xero" <jeff_at_chezjeff_dot_net> wrote in message
news:86**********************************@microsof t.com...
> hi.
> i have written this code to get the text in a NumericUpDown control:
>
> nudQuestions.Text
>
> and i start the application in debug mode and use the arrow keys that
> come
> with the numeric up down control to set the number to be 2. but when i
> break
> the process and view the value inside the control in Watch, it says
> that
> it
> is "1".
>
> how can i get its value correctly? thanks.
>
> --
> Xero
>
> http://www.chezjeff.net
> My personal web portal


Nov 21 '05 #5
hi,

i still have a problem: the Value property displays 1D whatever the number
in the control is. (i break the program at the line after the assignment.)

--
Xero

http://www.chezjeff.net
My personal web portal
"Ken Tucker [MVP]" wrote:
Hi,

If you look at the nudQuestions.Value in the debugger it will show
1D for a value of 1. The D means it is of the decimal type.

Ken
-----------------
"Xero" <jeff_at_chezjeff_dot_net> wrote in message
news:1E**********************************@microsof t.com...
hi. thanks for replying.

i tried the code you gave me but the value now returns "1D" whatever the
number is.

what is wrong?

--
Xero

http://www.chezjeff.net
My personal web portal
"Ken Tucker [MVP]" wrote:
Hi,

nudQuestions.value

Ken
--------------------
"Xero" <jeff_at_chezjeff_dot_net> wrote in message
news:86**********************************@microsof t.com...
> hi.
> i have written this code to get the text in a NumericUpDown control:
>
> nudQuestions.Text
>
> and i start the application in debug mode and use the arrow keys that
> come
> with the numeric up down control to set the number to be 2. but when i
> break
> the process and view the value inside the control in Watch, it says
> that
> it
> is "1".
>
> how can i get its value correctly? thanks.
>
> --
> Xero
>
> http://www.chezjeff.net
> My personal web portal


Nov 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: abc my vclass | last post by:
My win-form have many numericupdown controls to applied. But numericupdown control don't like textbox, text box control can automatic selected text when got focus. Is there any method can let me...
4
by: illegal.prime | last post by:
Hey all, I have a NumericUpDown control on a Panel or potentially a Form that have AutoScroll enabled. When the NumericUpDown is active I would like the Form/Panel/whatever not to scroll when I...
5
by: Len Weltman | last post by:
I am trying to pass a NumericUpDown object into a class method using Visual Studio 2005, but the control type is not found in Intellisense and the type declaration is flagged as an error. Here...
2
by: =?Utf-8?B?U2hhcm9u?= | last post by:
Hello experts, I posted a disturbing question in here:...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.