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);
        }

					

Leave a Reply

Your email address will not be published. Required fields are marked *