|
-
Jul 30th, 2002, 07:16 AM
#1
Thread Starter
Addicted Member
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?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|