Hi, I have already open a thread about this subject but I canĀ“t find it on forums to see if you already gave me an answer, so here go my problem again.
I have a Form, and the form has the keypreview property set to true, so using the Form KeyDown event I close the form when user press Esc Key.
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyValue == 27)
{
FormCalificacionesRegistro.ActiveForm.Close();
}
}
The proble is when I use a RadGridView on the form, when I press Esc Key, I got the error
Objetc Reference not set to an instance of an object, doing reference to my MDI Parent Form called FormMenuPrincipal
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new FormMenuPrincipal());
}
Thank you
I have a Form, and the form has the keypreview property set to true, so using the Form KeyDown event I close the form when user press Esc Key.
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyValue == 27)
{
FormCalificacionesRegistro.ActiveForm.Close();
}
}
The proble is when I use a RadGridView on the form, when I press Esc Key, I got the error
Objetc Reference not set to an instance of an object, doing reference to my MDI Parent Form called FormMenuPrincipal
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new FormMenuPrincipal());
}
Thank you