How to: Designate a Windows Forms Button as the Cancel Button
.NET Framework 2.0
On any Windows Form, you can designate acontrol to be the cancel button. A cancel button is clicked whenever the user presses the ESC key, regardless of which other control on the form has the focus. Such a button is usually programmed to enable the user to quickly exit an operation without committing to any action.
To designate the cancel button
Set the form'sproperty to the appropriate Button control.