Hello, I have the following question, I instantiated a new form with the following code:
Form frmDialog = new Form();
Well, I want to do the following, in the form where I instantiated this new Form, I can use the following code:
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
switch(keyData)
{
case Keys.Escape:
Close();
break;
}
return base.ProcessCmdKey(ref msg, keyData);
}
I would like to know how to instantiate this method to work in frmDialog (New Form.)
What this code does: When I press Escape (ESC), the form closes.