Note : Keypreviw = True in Form Property
Then Write This Code in KeyDown Event
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Escape)
this.Close();
}
Then Write This Code in KeyDown Event
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Escape)
this.Close();
}
No comments :
Post a Comment