HI all:
i want to ask how i can make ESC button active in form so when i press ESC in active form the form closed??
thanks
HI all:
i want to ask how i can make ESC button active in form so when i press ESC in active form the form closed??
thanks
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Ryan AlfordPosted Mar 20, 2009, 12:15 PM
then set the "CancelButton" property of the form to that button(it will be in the dropdown). The "CancelButton" is the button that will be fired when you hit the ESC button on the keyboard. So whatever code is in that click event will get run when you hit ESC.
Mirko MeierPosted Mar 19, 2009, 2:42 PM
Bob LewistonPosted Mar 19, 2009, 2:03 PM
AlanPosted Mar 22, 2008, 7:23 PM
Omar MardiniPosted Mar 22, 2008, 6:55 PM
Thank You but i've test it but nothing happen
pls help
Bechir BejaouiPosted Mar 21, 2008, 5:37 PM
{
if (e.KeyCode == Keys.Escape)
this.Close();
}