private void button1_Click(object sender, System.EventArgs e)
{
MessageBox.Show("你在文本框里按下了回车键");
}
private void textBox1_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
if(e.KeyChar==(byte)Keys.Return)
{
button1_Click(null,null);
}
}