If you have a cancel button on your form, you can set the Form.CancelButton property to that button and then pressing escape will effectively 'click the button'.
If you don't have such a button, check out the Form.KeyPreview property.
You will also have to set the KeyPreview property to true.
Gets or sets a value indicating whether the form will receive key events before the event is passed to the control that has focus.
However, as Gargo points out in his answer this will mean that pressing Esc to abort an edit on a control in the dialog will also have the effect of closing the dialog. To avoid that override the ProcessDialogKey method as follows:
The best way i found is to override the "ProcessDialogKey" function. This way canceling an open control is still possible because the function is only called when no other control uses the pressed Key.
This is the same behaviour as setting the CancelButton property. Using the KeyDown Event fires always and thus the form will close even when it should cancel the edit of an open editor.