Can anyone help please?
How can I give focus to a textbox (for example we have two) by defining a shortcut key as alt+m ?
Thanks in advance
Btw, I'm a beginner so please tell me in the simplest way. :)
Use a Label in front of each text box and in the Caption for the Label, use an & in front of the letter to define the shortcut key - &m in your example. Make sure the Label's TabIndex is one less than the TabIndex for its associated TexBox. That should do it.
While, I would suggest using a menu with a key combination shortcut, the suggestion by SCBWV does work...
Start a new standard exe project and add in this order, text box (text1), label (label1), text box (text2). Now set the caption of the label to &Focus. You should see Focus in the labels caption. Now, just to make sure that the tab orders are correct, lets check.
For Each ctrl As Control In Me.Controls("pnlMainPanel").Controls
If ctrl.GetType Is GetType(System.Windows.Forms.Panel) Then
For Each subCtrl As Control In ctrl.Controls
If subCtrl.GetType Is GetType(System.Windows.Forms.TextBox) Then
If subCtrl.GetType Is ...