Friends I am new to VB.Net
Please help me
I have two text boxes. When I press the 'Enter' key in the first text box the focus should go to the second textbox
What will be the code?
mavtcr -3 Junior Poster
Recommended Answers
Jump to PostYou can use something like this:
Private Sub TextBox1_KeyDown(sender As Object, e As KeyEventArgs) Handles TextBox1.KeyDown If e.KeyCode = Keys.Enter Then TextBox2.Focus() End If End Sub
Jump to PostI suggest using CTRL instead of ALT for two reasons:
- CTRL-ENTER is used in many other apps for this purpose
- ALT typically activates the menu
Jump to Post@ cambalinho
Read the OP's question carefully and before telling me my code is incomplete try it first and put it in the correct event, keydown on textbox1.
All 9 Replies
cambalinho 142 Practically a Posting Shark
Minimalist 96 Posting Pro
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster
cambalinho commented: thansk for correct me ;) +2
cambalinho 142 Practically a Posting Shark
Minimalist 96 Posting Pro
cambalinho 142 Practically a Posting Shark
Minimalist 96 Posting Pro
cambalinho 142 Practically a Posting Shark
G_Waddell 131 Posting Whiz in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.