This blog is only for C# Windows Aplication & Web Application & Other feature is css & jquery & Sql store procedure
Saturday, May 16, 2015
How to close winforms by pressing escape key
STEP 1
First Set KeyPreview Property True in Form
STEP 2
Now Create One Keydown event of Form
STEP 3
Write Below Code in Keydown Event
if (e.KeyCode == Keys.Escape)
{
this.Close();
}
First Set KeyPreview Property True in Form
STEP 2
Now Create One Keydown event of Form
STEP 3
Write Below Code in Keydown Event
if (e.KeyCode == Keys.Escape)
{
this.Close();
}
Subscribe to:
Posts
(
Atom
)