Set ToolStripTextBox Focus when Opening the form
11-Nov-0909 Leave a comment
me.ActiveControl=me.ToolStripTextBox.Control
You also need to set the ToolStrip’s (not the ToolStripTextBox’s – it doesn’t have the property) TabStop property to True.
Also if you set this active control on form load, then if you hide the form you may change the focus when it becomes visible again.
Could use following
PrivateSub frm_VisibleChanged(sender AsObject, e As System.EventArgs) HandlesMe.VisibleChanged
If Me.Visible Then
‘ToolStrip1.TabStop = True
ActiveControl = InputProductToolStripTextBox.Control
End If
EndSub
Advertisements