Assuming that you have a txt1 and txt2 textbox on your WinForm, this code
works for me:
Private Sub txt2_KeyPress(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles txt2.KeyPress
If e.KeyChar = Chr(13) Then
txt1.Focus()
End If
End Sub
"RedS" <an*******@discussions.microsoft.com> wrote in message
news:12****************************@phx.gbl...
Hellow there, If have try this code dusing keydown event
If e.KeyCode = Keys.Enter then
txtA.Focus()
end if
Its work but when I try to click the textbox A again its
locked. How come this happen?
How to do it in keypress event
Thanks
-----Original Message-----
In a Windows Forms application, you would be looking for
the enter key beingpressed during textbox A's KeyPress event.
"RedS" <an*******@discussions.microsoft.com> wrote in
messagenews:27****************************@phx.gbl... Hi I have two texbox A and B. What I want to ask is how
to set if I press enter in textbox A and it set focus to textbox B.
Thanks
.