System.Windows.Forms.Form.CancelButton:
Gets or sets the button control that is clicked when the user presses the ESC key.
So, basically, it’s the same thing as the .Default window paramater in GTK#, except for escape instead of the enter key. Does this exist, and am I just missing it, or would I have to try to hack something together to get this functionality?
Edit: Since two people have done this, this question is about GTK#, not Winforms. I need to get the same functionality as CancelButton in winforms, but I need it in GTK#.
After toying with this for a while, it seems that unlike Winforms (without playing around with them at least), GTK seems to pass key events right down the widget tree, so, the following code works just fine with focus on any widget on the window: