La Web del Programador: Comunidad de Programadores
 
    Pregunta:  6242 - SENDKEYS
Autor:  Cristian Gabriel
Tengo el siguiente poblema:
En un TextBox utilizo el evento KeyPress. Sucede que al ejecutarse, se me deshabilitan las teclas NumLock y CapsLock. Este es el código que estoy utilizando:

Private Sub txtClave_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{TAB}"
SendKeys "{ENTER}"
End If
End Sub

Alguien sabe porqué sucede esto?

Gracias colegas!.

  Respuesta:  Oscar
Hola Buenas,he probado lo que decias.
Prueba con este codigo yo lo he probado y funciona no se deshabilitan las teclas.

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{tab}"
KeyAscii = 0
End If
End Sub

  Respuesta:  Daniel Figueroa
Prueba agregando ,True

Private Sub txtClave_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{TAB}", True
SendKeys "{ENTER}", True
End If
End Sub

Si no te funciona, envia un mail a mi dirección y buscare la forma utilizando las API.

Un Abrazo.
DFA