problema con sendkeys

13/03/2005 - 13:24 por Hugo Gsell | Informe spam
tengo problemas con el sendkeys... tengo el siguiente evento keypress, es
decir, cuando presione enter en este objeto (tCuit) deseo que pase al
siguiente objeto segun su tabindex... en vb6 me funcionaba, aunque la verdad
era mas simple:

If KeyAscii = vbkeyreturn Then SendKeys "{tab}"'esto era en vb6

Esto l oque no me funciona en .NET

Private Sub tCuit_KeyPress(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles tCuit.KeyPress
If e.KeyChar = Microsoft.VisualBasic.ChrW(13) Then
SendKeys.SendWait("{ENTER}")
End If
End Sub


Hugo A. Gsell
Sgo del Estero
Argentina
 

Leer las respuestas

#1 Alma Yolanda Díaz Valdez
13/03/2005 - 18:40 | Informe spam
Debes tener la propiedad KeyPreview de la forma en TRUE
=
Private Sub frmContactos_KeyPress(ByVal sender As Object, _
ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles MyBase.KeyPress
' Debes tener la propiedad KeyPreview de la forma en TRUE
If e.KeyChar = Chr(Keys.Enter) Then
SendKeys.Send("{TAB}")
End If
End Sub


Saludos

Alma Yolanda Díaz Valdez

"Hugo Gsell" escribió en el mensaje
news:
tengo problemas con el sendkeys... tengo el siguiente evento keypress, es
decir, cuando presione enter en este objeto (tCuit) deseo que pase al
siguiente objeto segun su tabindex... en vb6 me funcionaba, aunque la
verdad
era mas simple:

If KeyAscii = vbkeyreturn Then SendKeys "{tab}"'esto era en vb6

Esto l oque no me funciona en .NET

Private Sub tCuit_KeyPress(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles tCuit.KeyPress
If e.KeyChar = Microsoft.VisualBasic.ChrW(13) Then
SendKeys.SendWait("{ENTER}")
End If
End Sub


Hugo A. Gsell
Sgo del Estero
Argentina



Preguntas similares