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. Key Press Event

Key Press Event

Scheduled Pinned Locked Moved C#
comquestion
4 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.
  • X Offline
    X Offline
    Xmen Real
    wrote on last edited by
    #1

    hi i wanna know how can i write codes in key press event of textbox because i can not see textbox in this menu(screenshot) http://aycu15.webshots.com/image/22014/2003314000409542092_rs.jpg[^]

    N S 2 Replies Last reply
    0
    • X Xmen Real

      hi i wanna know how can i write codes in key press event of textbox because i can not see textbox in this menu(screenshot) http://aycu15.webshots.com/image/22014/2003314000409542092_rs.jpg[^]

      N Offline
      N Offline
      Nisar Inamdar
      wrote on last edited by
      #2

      :cool:hi, Do one thing........... In properties window of textbox select events tab (shown like lighting)... there is keypress event.............just doble click on it..........it will goes to code the function...........:cool: Nisar Inamdar............. Always for U..........

      1 Reply Last reply
      0
      • X Xmen Real

        hi i wanna know how can i write codes in key press event of textbox because i can not see textbox in this menu(screenshot) http://aycu15.webshots.com/image/22014/2003314000409542092_rs.jpg[^]

        S Offline
        S Offline
        Stu Richardson
        wrote on last edited by
        #3

        There are two ways you can create the event handler routines for the key press event. Firstly in your initialisation routine type the following: (where "textBox1_KeyPress" will become the event handler routine) textBox1.KeyPress += new KeyPressEventHandler(textBox1_KeyPress); (As you are using Visual studio as soon as you type the "+=" part Visual Studio should prompt you with an auto complete option - press tab twice and it will create both the above line and the event handler routine) 2nd way is through the form designer. Click on the textbox and go to the textbox properties window. Click on the events button (the little lightning icon) then simply double click inside the KeyPress item in the list. This will create the routine for you and should take you to the code.

        X 1 Reply Last reply
        0
        • S Stu Richardson

          There are two ways you can create the event handler routines for the key press event. Firstly in your initialisation routine type the following: (where "textBox1_KeyPress" will become the event handler routine) textBox1.KeyPress += new KeyPressEventHandler(textBox1_KeyPress); (As you are using Visual studio as soon as you type the "+=" part Visual Studio should prompt you with an auto complete option - press tab twice and it will create both the above line and the event handler routine) 2nd way is through the form designer. Click on the textbox and go to the textbox properties window. Click on the events button (the little lightning icon) then simply double click inside the KeyPress item in the list. This will create the routine for you and should take you to the code.

          X Offline
          X Offline
          Xmen Real
          wrote on last edited by
          #4

          yep i like the second one, easy and gud... thanks dudes

          Becoming Programmer...

          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