Problems with SENDKEYS in Windos200 pro

I have a aplication deveveloped with vb6.0,
I use sendkeys in keypress event.
E.g.
Private Sub Text1_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then
        SendKeys "{TAB}"
        KeyAscii = 0
    End If
End Sub

but when I use the aplication in Windows2000 pro, my keyboard is lock it.

How Can i solve this problem?
LVL 1
jmgs082598Asked:
Who is Participating?
 
Valliappan ANConnect With a Mentor Senior Tech ConsultantCommented:
Give a try to:

   If KeyAscii = 13 Then
       KeyAscii = vbKeyTab
   End If

Cheers
0
 
Dave_GreeneCommented:
I would put the code in the KeyUp method.
0
 
glass_cookieCommented:
Hi!

Have you tried using the keydown() event?

That's it!

glass cookie : )
0
 
PeteDCommented:
valli_an is right! Its bad to use sendkeys as it is very unreliable!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.