private void Form1_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
{
e.IsInputKey = true;
MessageBox.Show(e.KeyValue.ToString());
}
protected override bool IsInputKey(Keys keyData)
{
if (keyData == Keys.Up || keyData == Keys.Down || keyData == Keys.Left || keyData == Keys.Right)
{
return true;
}
else
{
return base.IsInputKey(keyData);
}
}