I have the following event:
private void TelaAcao_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyValue.Equals(27))
{
this.Close();
}
}
The result of this is that every time I press ESC
, the form is closed. However, I would like you to press once to call a method to clear the controls and press ALL the empty controls to close the screen.
How can I do this? A% of% within this first if()
? Do I have to go from field to field to see if they are equal to " if (e.KeyValue.Equals(27))
"?