Public Sub onEnter_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs)
If e.KeyCode = Keys.Enter Then
SendKeys.Send("{TAB}")
End If
End Sub
Dim xControl As Control
For Each xControl In Me.Controls
AddHandler xControl.KeyDown, AddressOf onEnter_KeyDown
Next
Private Sub TextBox_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress, _
TextBox2.KeyPress
If e.KeyChar = Convert.ToChar(Keys.Enter) Then
Me.SelectNextControl(DirectCast(sender, Control), True, True, True, True)
End If
End Sub