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. Visual Basic
  4. simple textbox that limits its value to numeric (limiting the lenght and the number of decimals)

simple textbox that limits its value to numeric (limiting the lenght and the number of decimals)

Scheduled Pinned Locked Moved Visual Basic
tutorialquestion
3 Posts 3 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.
  • K Offline
    K Offline
    kanagaraj kumar
    wrote on last edited by
    #1

    Do you have a working example of that somewhere? All I need is a simple textbox that limits its value to numeric (limiting the lenght and the number of decimals) kanagaraj kumar

    T C 2 Replies Last reply
    0
    • K kanagaraj kumar

      Do you have a working example of that somewhere? All I need is a simple textbox that limits its value to numeric (limiting the lenght and the number of decimals) kanagaraj kumar

      T Offline
      T Offline
      toxcct
      wrote on last edited by
      #2

      override the KeyPress event


      TOXCCT >>> GEII power
      [toxcct][VisualCalc]

      1 Reply Last reply
      0
      • K kanagaraj kumar

        Do you have a working example of that somewhere? All I need is a simple textbox that limits its value to numeric (limiting the lenght and the number of decimals) kanagaraj kumar

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

        Funny enough, I answered this for someone earlier today. Handle keypress and if it's not a number, a control char or the first dot, set e.Handled to true. Use char.IsNumber and char.IsControl. Remember that in some locales, a comma is the decimal point, and a dot indicates thousands. Christian Graus - Microsoft MVP - C++

        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