How can I override the arrow keys on a form?

Usually the arrow keys change focus of the control on a form.

How can I override this behaviour?

C#
VS 2005
purplesoupAsked:
Who is Participating?
 
vo1dConnect With a Mentor Commented:
you have to override the forms ProcessCmdKey message.
0
 
Jase-CoderCommented:
override the form event : KeyDown
0
 
purplesoupAuthor Commented:
Jase-Coder:
This doesn't work. Overriding the form's keydown event is actually just ignored *unless* you set the KeyPreview property on the form to True (it is false by default); however even then this simply responds to standard keyboard keys (e.g. the letters) rather than the arrow keys.

vo1d:
This works - there is a full Microsoft article at:
http://support.microsoft.com/?scid=http%3a%2f%2fwww.support.microsoft.com%2fkb%2f320584%2f

Thanks.
0
 
vo1dCommented:
thanks for that link ;)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.