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 in hexadecimal mode bug

NumericUpDown in hexadecimal mode bug

Scheduled Pinned Locked Moved C#
helpquestion
3 Posts 2 Posters 4 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.
  • S Offline
    S Offline
    Schokoolero
    wrote on last edited by
    #1

    When I use a NumericUpDown with Hexadecimal=false and a number that is too large or to small is entered, it is set to the corresponding limit. With Hexadecimal=true however, the value is reset to the previous, correct, value, when a value too large or too small is entered. I have tried to intercept the ValueChanged and various other events to get the same effect as with Hexadecimal=false, but there seems to be no situation in which I can read the entered value instead of the already reset value and adjust it manually. Does anybody know a solution to this problem? Thanks

    N 1 Reply Last reply
    0
    • S Schokoolero

      When I use a NumericUpDown with Hexadecimal=false and a number that is too large or to small is entered, it is set to the corresponding limit. With Hexadecimal=true however, the value is reset to the previous, correct, value, when a value too large or too small is entered. I have tried to intercept the ValueChanged and various other events to get the same effect as with Hexadecimal=false, but there seems to be no situation in which I can read the entered value instead of the already reset value and adjust it manually. Does anybody know a solution to this problem? Thanks

      N Offline
      N Offline
      Nader Elshehabi
      wrote on last edited by
      #2

      Try to handle Validating or KeyDown events

      Regards:rose:

      S 1 Reply Last reply
      0
      • N Nader Elshehabi

        Try to handle Validating or KeyDown events

        Regards:rose:

        S Offline
        S Offline
        Schokoolero
        wrote on last edited by
        #3

        Thanks for the reply! I tried Validating, but that is only thrown, when the NumericUpDown gets the focus or looses it and in similar situations. It doesn't seem to be thrown right before the value is changed wrongly. I also tried KeyDown, but wasn't able to intercept the value the NumericUpDown should take after the Key was pressed if there was no maximum and exchange it for the real value. I solved my problem by enhancing a TextBox to take only hexadecimal numbers, adding a minimum and maximum etc. to it.

        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