UseMnemonic property of Label, when set to False, displays the Text as it is(With all the ampersands). This is very useful when the Label is Bounded to a Datasource on form. when False, It does not have a short cut key.
When set to true, It behaves differently..
Say you have Label1 and Text1 , Label has Caption "&Name"
We cannot set the HotKey for TextBox, So when Alt-N is pressed, focus is moved to the textbox adjacent to the label control.
Just Take care that the Textbox's TabIndex property must be immediately after the TabIndex Property of the Label Control. If the Label Control's TabIndex property is 15, the Textbox must be 16.
Say you are in textbox of tabIndex =7
and you want to Jump to a textbox with tabIndex 15,
You need to press Tab for 8 more times.
Instead, Give shortcut key to the Label asociated with it, and with that short-cut, jump to the required textbox..
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 ...