Kschuler's answer, to use a hidden menu control, is interest; I can see where that would be useful in a number of situations.
How I have done something like this, though, is to start by setting the
KeyPreview property of the form to
True
, then adding this to the form's code:
Private Sub Form1_KeyDown(ByVal sender As Object, _
ByVal e As System.Windows.Forms.KeyEventArgs) _
Handles Me.KeyDown
If e.Control AndAlso e.Shift Then
Select Case e.KeyCode
Case Keys.D1
TextBox1.Focus()
Case Keys.D2
TextBox2.Focus()
Case Keys.D3
TextBox3.Focus()
End Select
End If
End Sub
In this case, I have a form with three
TextBox
controls. When the Ctrl, Shift and either 1, 2 or 3 keys are pressed at the same time, the appropriate control gets the focus.