0

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.

2
Contributors
3
Replies
4
Views
5 Years
Discussion Span
Last Post by M.Waqas Aslam
1

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

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.