System.Windows.Input空间里有个"Key"类中提供了键盘上可能的键的枚举值,如:
private void textBox1_KeyDown(object sender, KeyEventArgs e) { if (e.Key == System.Windows.Input.Key.Enter) MessageBox.Show("回车"); }