Allow a UserControl to handle arrow keys

By default the arrow keys are processed by the form, to use them yourself override the following method.

 protected override bool IsInputKey(Keys keyData)
        {
            switch (keyData)
            {
                case Keys.Up:
                case Keys.Down:
                case Keys.Left:
                case Keys.Right:
                    return (true);
             }
            return base.IsInputKey(keyData);
        }

					
Lastest update in January 2012, inital post in January 2012

Write a comment

I appreciate comments, suggestions, compliments etc. Unfortunately I have no time to reply to them. Useful input will be used for sure!