e.Handled =false; ,但是键盘还能正常输入

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApplication33
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

    private void textBox1_KeyDown(object sender, KeyEventArgs e)
    {
        e.Handled =false;
        label1.Text = e.Handled.ToString();
    }
}

}

e.Handled为false的时候表示可以接受该事件

e.Handled = true;//为true时表示已经处理了事件(即不处理当前键盘事件)

KeyDown事件用来处理功能键:F1 F2 F3…
keyPress事件用来处理字符比如说:A B C… 1 2 3…
注:处理该事件时,需要先将窗体的 KeyPreview=true; (请注意,不设置该项是引起键盘事件不响应的多数原因)

KeyPress事件的示例:
private void FormMain_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar.ToString() == Keys.A.ToString())
{
this.TSMIGoto_Click(sender, e); //满足条件后执行事件
}
}

KeyDown事件的示例:
private void FormMain_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyData == Keys.F8)
{
this.TSMIGoto_Click(sender, e); //满足条件后执行事件
}
}

改成e.Handled = true