How can I override the arrow keys on a form?

Posted on 2006-05-13
Last Modified: 2010-04-16
Usually the arrow keys change focus of the control on a form.

How can I override this behaviour?

VS 2005
Question by:purplesoup
    LVL 11

    Expert Comment

    override the form event : KeyDown
    LVL 11

    Accepted Solution

    you have to override the forms ProcessCmdKey message.

    Author Comment

    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.

    This works - there is a full Microsoft article at:

    LVL 11

    Expert Comment

    thanks for that link ;)

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
    Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now