Your tip is useful for main forms with no close or cancel button. But most time you will want the "escape-close-form-behaviour" only with dialogs. This is the recommended way to do it: (Now i see Indivara already mentioned it in the comments)
using System;
using System.Windows.Forms;
namespace CloseByEscape
{
static class Program
{
static void Main()
{
Form formDialog = new Form();
Button button = new Button();
button.Text = "Close";
formDialog.CancelButton = button;
formDialog.Controls.Add(button);
button.Click += delegate(object sender, EventArgs e)
{
formDialog.Close();
};
Application.Run(formDialog);
}
}
}