textbox keypress event
-
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
-
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
Hello Is that Visual basic?? You're in the wrong forum. You should go to Visual Basic .Net forum[^] A quick hint quoted from MSDN in the KeyPressEventArgs remarks: "You cannot get or set the following keys: The TAB key. INSERT and DELETE. HOME. END. PAGE UP and PAGE DOWN. F1-F2. ALT. Arrow keys. " So if you want to catch the tab key, use the KeyUp event instead Regards:rose: