Cursor Move Next object by Pressing Enter
This code shows how to cursor move to the next object by pressing Enter or Return key by Keyboard.
Call subprocedure EnterNextTab under Object Keypress procedure.
Private Sub txtEmpNo_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtEmpNo.KeyPress
EnterNextTab(Me.txtEmpNo, e)
End Sub
This sub prcedure ensure to move the cursor to the next Object
Public Sub EnterNextTab(ByVal Sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs)
Dim KeyAscii As Short = Asc(e.KeyChar)
If KeyAscii = 13 Then
System.Windows.Forms.SendKeys.Send("{TAB}")
End If
e.KeyChar = Chr(KeyAscii)
If KeyAscii = 0 Then
e.Handled = True
End If
End Sub