Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. NumericUpDown Control [modified]

NumericUpDown Control [modified]

Scheduled Pinned Locked Moved C#
csharpperformancehelpannouncement
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    myNameIsRon
    wrote on last edited by
    #1

    Hi, I'm using a NumericUpDown control (C# .NET 2.0 Windows Form) so user can enter a quantity value. After the WinForm's data is saved, I want to reset the NumbericUpDown control to it's default value (1). Using this code works if any value is in the box: numericUpDown_Quantity.Value = 1; but if the user removes all text (values) from the NumericUpDown box, it does not paste the 1 back into the box. The value has updated in memory (if you click UP, the next value is 2), but the box still shows empty. I've tried: numericUpDown_Quantity.Update(); numericUpDown_Quantity.Refresh(); numericUpDown_Quantity.ResetText(); Any help would be appreciated. Thanks, Ron -- modified at 18:02 Sunday 18th March, 2007

    D 1 Reply Last reply
    0
    • M myNameIsRon

      Hi, I'm using a NumericUpDown control (C# .NET 2.0 Windows Form) so user can enter a quantity value. After the WinForm's data is saved, I want to reset the NumbericUpDown control to it's default value (1). Using this code works if any value is in the box: numericUpDown_Quantity.Value = 1; but if the user removes all text (values) from the NumericUpDown box, it does not paste the 1 back into the box. The value has updated in memory (if you click UP, the next value is 2), but the box still shows empty. I've tried: numericUpDown_Quantity.Update(); numericUpDown_Quantity.Refresh(); numericUpDown_Quantity.ResetText(); Any help would be appreciated. Thanks, Ron -- modified at 18:02 Sunday 18th March, 2007

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      You tried everything, except setting the controls Text property, which is sperate from it's Value property.

      Dave Kreskowiak Microsoft MVP - Visual Basic

      M 1 Reply Last reply
      0
      • D Dave Kreskowiak

        You tried everything, except setting the controls Text property, which is sperate from it's Value property.

        Dave Kreskowiak Microsoft MVP - Visual Basic

        M Offline
        M Offline
        myNameIsRon
        wrote on last edited by
        #3

        Thanks Dave, I didn't realize I could use the Text property becuase it's not listed in IntelliSense. It works great... I'm not sure why it's not listed in IntelliSense. I've noticed that if the Up or Down buttons are used, this problem does not occur. Only if the user deletes the text before Up/Down does Value=1 not work. Ron

        D 1 Reply Last reply
        0
        • M myNameIsRon

          Thanks Dave, I didn't realize I could use the Text property becuase it's not listed in IntelliSense. It works great... I'm not sure why it's not listed in IntelliSense. I've noticed that if the Up or Down buttons are used, this problem does not occur. Only if the user deletes the text before Up/Down does Value=1 not work. Ron

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          Yeah, that's why I do my research in the documentation instead of Intellisense. There's lots of hidden stuff in the docs that you'll never see anywhere else.

          Dave Kreskowiak Microsoft MVP - Visual Basic

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups