Getting the text in NumericUpDown

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Xero

    #1

    Getting the text in NumericUpDown

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

    nudQuestions.Te xt

    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


    My personal web portal
  • Crouchie1998

    #2
    Re: Getting the text in NumericUpDown

    I think this is what you mean:

    Private Sub NumericUpDown1_ ValueChanged(By Val sender As System.Object, ByVal
    e As System.EventArg s) 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


    Comment

    • Ken Tucker [MVP]

      #3
      Re: Getting the text in NumericUpDown

      Hi,

      nudQuestions.va lue

      Ken
      --------------------
      "Xero" <jeff_at_chezje ff_dot_net> wrote in message
      news:8696DA57-CDD6-4092-B46E-C8410126356B@mi crosoft.com...[color=blue]
      > hi.
      > i have written this code to get the text in a NumericUpDown control:
      >
      > nudQuestions.Te xt
      >
      > 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[/color]


      Comment

      • Xero

        #4
        Re: Getting the text in NumericUpDown

        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


        My personal web portal


        "Ken Tucker [MVP]" wrote:
        [color=blue]
        > Hi,
        >
        > nudQuestions.va lue
        >
        > Ken
        > --------------------
        > "Xero" <jeff_at_chezje ff_dot_net> wrote in message
        > news:8696DA57-CDD6-4092-B46E-C8410126356B@mi crosoft.com...[color=green]
        > > hi.
        > > i have written this code to get the text in a NumericUpDown control:
        > >
        > > nudQuestions.Te xt
        > >
        > > 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[/color]
        >
        >
        >[/color]

        Comment

        • Ken Tucker [MVP]

          #5
          Re: Getting the text in NumericUpDown

          Hi,

          If you look at the nudQuestions.Va lue 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_chezje ff_dot_net> wrote in message
          news:1EC3C451-1A5C-4EA3-87BD-1ECFF2557179@mi crosoft.com...[color=blue]
          > 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:
          >[color=green]
          >> Hi,
          >>
          >> nudQuestions.va lue
          >>
          >> Ken
          >> --------------------
          >> "Xero" <jeff_at_chezje ff_dot_net> wrote in message
          >> news:8696DA57-CDD6-4092-B46E-C8410126356B@mi crosoft.com...[color=darkred]
          >> > hi.
          >> > i have written this code to get the text in a NumericUpDown control:
          >> >
          >> > nudQuestions.Te xt
          >> >
          >> > 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[/color]
          >>
          >>
          >>[/color][/color]


          Comment

          • Xero

            #6
            Re: Getting the text in NumericUpDown

            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


            My personal web portal


            "Ken Tucker [MVP]" wrote:
            [color=blue]
            > Hi,
            >
            > If you look at the nudQuestions.Va lue 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_chezje ff_dot_net> wrote in message
            > news:1EC3C451-1A5C-4EA3-87BD-1ECFF2557179@mi crosoft.com...[color=green]
            > > 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:
            > >[color=darkred]
            > >> Hi,
            > >>
            > >> nudQuestions.va lue
            > >>
            > >> Ken
            > >> --------------------
            > >> "Xero" <jeff_at_chezje ff_dot_net> wrote in message
            > >> news:8696DA57-CDD6-4092-B46E-C8410126356B@mi crosoft.com...
            > >> > hi.
            > >> > i have written this code to get the text in a NumericUpDown control:
            > >> >
            > >> > nudQuestions.Te xt
            > >> >
            > >> > 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
            > >>
            > >>
            > >>[/color][/color]
            >
            >
            >[/color]

            Comment

            Working...