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. .NET (Core and Framework)
  4. How To Restrict

How To Restrict

Scheduled Pinned Locked Moved .NET (Core and Framework)
csharptutorial
4 Posts 4 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
    mjawadkhatri
    wrote on last edited by
    #1

    How To Restrict textbox control for numaric key in vb .net

    R T D 3 Replies Last reply
    0
    • M mjawadkhatri

      How To Restrict textbox control for numaric key in vb .net

      R Offline
      R Offline
      Rajesh Anuhya
      wrote on last edited by
      #2

      Try This..

          private void textBox1\_KeyPress(object sender, KeyPressEventArgs e)
          {
              if (char.IsDigit(e.KeyChar))
                  e.KeyChar = (char)(0x00);
                     
      
          }
      

      Rajesh B --> A Poor Workman Blames His Tools <--

      1 Reply Last reply
      0
      • M mjawadkhatri

        How To Restrict textbox control for numaric key in vb .net

        T Offline
        T Offline
        The Man from U N C L E
        wrote on last edited by
        #3

        Use a MaskedTextBox instead or maybe a NumericUpDown control.

        If you have knowledge, let others light their candles at it. Margaret Fuller (1810 - 1850) [My Articles]  [My Website]

        1 Reply Last reply
        0
        • M mjawadkhatri

          How To Restrict textbox control for numaric key in vb .net

          D Offline
          D Offline
          DaveAuld
          wrote on last edited by
          #4

          Go and visit the VB Forum, strange that there is someone asking the same question over there! You two individuals on the same course / doing the same homework / working on the same thing?

          Dave Don't forget to rate messages!
          Find Me On: Web|Facebook|Twitter|LinkedIn
          Waving? dave.m.auld[at]googlewave.com

          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