How to Assign Hotkeys to a Text Box in Visual Basic
- 1). Click the Windows "Start" button and select "All Programs." Click the "Microsoft .NET" program group, then click "Visual Studio" to open the programming software. Double-click the project name in the list of "Recent Projects" to load the Visual Basic forms and code files.
- 2). Double-click the form that contains your text box. In the toolbox on the left, drag and drop a "Label" control to a location adjacent to the text box. Notice a "Properties" window displays underneath the "Solution Explorer" panel on the right side of the work desk.
- 3). Click the arrow button next to the "UserMnemonic" property and select "True." Click the text box control and view the "TabIndex" property number. The TabIndex property for the label requires a value that is one less than the TabIndex of the text box. If the TabIndex for the text box is "5," assign the number "4" to the TabIndex property for the label control.
- 4). Click the "Text" option for the label. Type a name for the label and use an ampersand character in front of the key letter you want to use for the hotkey. For instance, if you want to use the "C" character as the hotkey for a text box labeled "Customer Name," type "&Customer Name" in the "Text" property for the label control.
Source...