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. keypress event on textbox

keypress event on textbox

Scheduled Pinned Locked Moved Visual Basic
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.
  • I Offline
    I Offline
    iramg
    wrote on last edited by
    #1

    i have different textboxes in my from on one textbox when i press a tab key i want print one messagebox i am writing thiss code but its not working on tab key although its working on like back key but not on tabkey plz tell me Private Sub ItemCode_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles ItemCode.KeyPress If (e.KeyChar = Microsoft.VisualBasic.ChrW(9)) Then MessageBox.Show("u have pressed tab key") End If

    O L 2 Replies Last reply
    0
    • I iramg

      i have different textboxes in my from on one textbox when i press a tab key i want print one messagebox i am writing thiss code but its not working on tab key although its working on like back key but not on tabkey plz tell me Private Sub ItemCode_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles ItemCode.KeyPress If (e.KeyChar = Microsoft.VisualBasic.ChrW(9)) Then MessageBox.Show("u have pressed tab key") End If

      O Offline
      O Offline
      Oktay1
      wrote on last edited by
      #2

      Try KeyDown event

      1 Reply Last reply
      0
      • I iramg

        i have different textboxes in my from on one textbox when i press a tab key i want print one messagebox i am writing thiss code but its not working on tab key although its working on like back key but not on tabkey plz tell me Private Sub ItemCode_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles ItemCode.KeyPress If (e.KeyChar = Microsoft.VisualBasic.ChrW(9)) Then MessageBox.Show("u have pressed tab key") End If

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        iramg wrote:

        i have different textboxes in my from on one textbox when i press a tab key i want print one messagebox

        How about using the lost focus event? Does this solution answer to what you need to do?

        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