Key event in VS2003

From: Thomas Alme (thomas_at_freedom-tech.no)
Date: 04/20/04


Date: Tue, 20 Apr 2004 10:32:15 +0200

I used this code and compiled it in VS2002 and there it works fine.

#region Key events
protected override void OnKeyDown(KeyEventArgs kea)
{
switch (kea.KeyData)
{
case Keys.Enter:
...
..
break;
case Keys.Escape:
this.Close();
break;
}
}
#endregion

The class is deriving from System.Windows.Forms.Form

I then compiled it in VS2003 and it woudn't enter the method when I make
a key event like Esc or any other.

Anyone knows why?

Thanks
Thomas