Back in the "old days" of VB6, Me.txtBox.SetFocus would give the text box of interest the focus. I'm in the process of learning VB.Net and this simple task appears to have changed. For the moment I'm using VB 2005 Express, I don't know if this matters, but I don't see a method to set the focus in code.
By submitting your personal information, you agree that TechTarget and its partners may contact you regarding relevant content, products and special offers.
Highlighted replies from CharlesJC and irarainey
Tony: In VB.Net(2003) object.Focus() does the trick. It should be the same if not very similar in VB2005. - CharlesJC
Tony: From the help file: The following code example sets focus to the specified Control, if it can receive focus.
Public Sub ControlSetFocus(control As Control)
' Set focus to the control, if it can receive focus.
If control.CanFocus Then
For more go to ITKnowledge Exchange [Reg Req]