private void textBox1_KeyDown(object sender, KeyEventArgs e) { if (e.KeyData == Keys.Enter) MessageBox.Show(“hello” + textBox1.Text); }
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyData == Keys.Escape)
{
this.Close();
}
}