Joe Kaminski
asked on
Setting Focus On A Control
I have a form with a tabcontrol. Within the 3rd tabpage of the 1st tabcontrol is another tabcontrol. On the 1st tabpage of the 2nd tabcontrol is a set of controls (datagridview, combobox, textbox, etc.). When I click on the 3rd tabpage of the 1st tabcontrol the "_Enter" event for the 3rd tabpage of the 1st tabcontrol is fired and the datagridview is loaded. Right after that I want to set the focus to the combobox that is also on that tabpage. The combobox.focus does not seem to work. Solution?
Private Sub tbpgTransactions_Enter(ByVal sender As Object, ByVal e As _
& System.EventArgs) Handles tbpgTransactions.Enter
SqlDataAdapter1.SelectCommand.CommandText = "SELECT * FROM HM_Transactions"
SqlDataAdapter1.Fill(HmsDataSet1.HM_Transactions)
cbMntTrnAccountNumber.SelectedIndex = 27
cbMntTrnAccountNumber.Focus()
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER