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. Integer/Decimal control in Windows Froms

Integer/Decimal control in Windows Froms

Scheduled Pinned Locked Moved C#
jsonquestion
2 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.
  • N Offline
    N Offline
    Nooie
    wrote on last edited by
    #1

    Am I going mad? Is there a control just for integer or decimal values? I have a form that is purely based on "controls" for decimal that result in Un-Editable "controls" as decimal results. The thing that concerns me is the amount of casting/parsing I am doing. Taking a text entry, parsing to decimal, doing my math then parsing back to decimal again to show in the results box. There is the numeric up/down control. But can you remove the up/down part of it to use it as a purely numeric control? Much appreciated Tony

    C 1 Reply Last reply
    0
    • N Nooie

      Am I going mad? Is there a control just for integer or decimal values? I have a form that is purely based on "controls" for decimal that result in Un-Editable "controls" as decimal results. The thing that concerns me is the amount of casting/parsing I am doing. Taking a text entry, parsing to decimal, doing my math then parsing back to decimal again to show in the results box. There is the numeric up/down control. But can you remove the up/down part of it to use it as a purely numeric control? Much appreciated Tony

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      No, you can't. You can create a text box derived class that only accepts numbers and encapsulates the parsing, that's as good as it gets.

      Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

      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