Sendkeys

Asso79

Freshman
Joined
Jun 6, 2003
Messages
35
I have a problem when i press enter i want that execute tab, but not work

Code:
Private Sub TextBox7_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown

If e.KeyData = Keys.Return Then
            SendKeys.Send("{TAB}")
End If

End Sub

[code]
 
I tried it and got it working. Just noticed though that Textbox7_KeyDown Handles Textbox1.KeyDown. Is this correct?
 
Excuse me:

Code:
Private Sub TextBox7_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox7.KeyDown
 
Doesn't e.handled = True need to be there also?

If e.KeyChar = Chr(Asc(vbCr)) Then
SendKeys.Send("{Tab}")
e.Handled = True
End If
 
Back
Top