I know how to set the tab order on the forms on VB.net. but i want to set such that when i press enter while on the form, the cursor will go to the next textbox based on the tab order set.

Recommended Answers

All 3 Replies

hello !
Yes,there is a way.

Set KeyPreview property of your Form to True.
And use this code for your Form_KeyDown event:

Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
        If e.KeyCode = Keys.Return Then
            SendKeys.Send("{TAB}")
        End If
    End Sub

hope this helps you.

Regards

thanx a lot!! it works...

you wc :)

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.