Click here to Skip to main content
15,884,989 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello
I want to know how to use arrow keys instead of tab key.
I used this code but it didn't work :
VB
Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
      If e.KeyCode = Keys.Up Then
          ProcessTabKey(True)
          e.Handled = True
      ElseIf e.KeyCode = Keys.Down Then
          ProcessTabKey(False)
          e.Handled = True
      End If
  End Sub

So ,what's the problem?
Thank in advance..
Posted

1 solution

Probably, you have controls which can take input from the keyboard - if you do they they get the event instead of the form.
You can force the form to get such events by setting the Form.KeyPreview to true, but I would think hard before changing fundamental behaviour like that - if users are not used to it, then you can confuse them and that can create a bad impression of your software.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900