0

Hello,

I have a VB form with 2 comboboxes and a textbox in which a user can type into.
I would like my mouse cursor to move from my 2nd combobox selection directly over to the textbox that I have on a VB form.

2nd comboboxe name: "CodeComboBox"
Textbox name where I would like my cursor to move to after the selection:"USDOTNumtxt"

I use the TextBoxName.Focus() in the SelectedIndexChanged but it doesn't function.

Here is my whole code:

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'PTSGenDataSet.qryMasterPurchasing' table. You can move, or remove it, as needed.
        Me.QryMasterPurchasingTableAdapter.Fill(Me.PTSGenDataSet.qryMasterPurchasing)
        'TODO: This line of code loads data into the 'PTSGenDataSet.qryMasterPolicyNumbers' table. You can move, or remove it, as needed.
        Me.QryMasterPolicyNumbersTableAdapter.Fill(Me.PTSGenDataSet.qryMasterPolicyNumbers)

    End Sub

    Private Sub CodeComboBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CodeComboBox.SelectedIndexChanged
        USDOTNumtxt.Focus()
        'Me.USDOTNumtxt.Focus()

    End Sub
End Class

Thanks
John

1
Contributor
1
Reply
4
Views
7 Years
Discussion Span
Last Post by JohnPhilipps
0

I found hte problem it was quite simple overlook.

John

Hello,

I have a VB form with 2 comboboxes and a textbox in which a user can type into.
I would like my mouse cursor to move from my 2nd combobox selection directly over to the textbox that I have on a VB form.

2nd comboboxe name: "CodeComboBox"
Textbox name where I would like my cursor to move to after the selection:"USDOTNumtxt"

I use the TextBoxName.Focus() in the SelectedIndexChanged but it doesn't function.

Here is my whole code:

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'PTSGenDataSet.qryMasterPurchasing' table. You can move, or remove it, as needed.
        Me.QryMasterPurchasingTableAdapter.Fill(Me.PTSGenDataSet.qryMasterPurchasing)
        'TODO: This line of code loads data into the 'PTSGenDataSet.qryMasterPolicyNumbers' table. You can move, or remove it, as needed.
        Me.QryMasterPolicyNumbersTableAdapter.Fill(Me.PTSGenDataSet.qryMasterPolicyNumbers)

    End Sub

    Private Sub CodeComboBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CodeComboBox.SelectedIndexChanged
        USDOTNumtxt.Focus()
        'Me.USDOTNumtxt.Focus()

    End Sub
End Class

Thanks
John

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.