How to catch Tab key in a text box?
In VB6 you can catch the Tab key pressed on KeyUpPress event in a text box by:
If KeyAscii = 9 Then
. . .
The same code in VB.Net looks like:
Private Sub Text1_KeyPress(ByVal eventSender As System.Object, ByVal eventArgs As System.Windows.Forms.KeyPressEventArgs) Handles
Text1.KeyPress
Dim KeyAscii As Short = Asc(eventArgs.KeyChar)
If KeyAscii = 9 Then
. . .
But it doesn’t work! It catches Enter key, or numbers, etc, but not Tab key.
Anyone has an idea what needs to be done to catch a Tab key?