Click on the x in upper right corner? Not sure what you are looking for but if you remove the Cancel button, clicking on the x will cancel the form.
The struggle is to be able to hit Escape and not have Cancel button.
Ok, I’m dumb. I just don’t populate the form with Abort button…
Are you saying you want to hit the Esc key on the keyboard to cancel the Eto form? Not really understanding what you are after.
You say Abort button but the form shows a Cancel button. I am assuming these are the same.
As you point out, you can just omit putting the Cancel button on your form.
Yep, I just called it Cancel.
I get really good results with my Eto forms after a really long learning curve. But then I heavily customized the functionality of the fields on my forms because I did not like some of their behaviors. It took awhile to sort thru the options and pick those that best matched my preferences.
Try handling the form’s KeyDown
event.
self.KeyDown += self.OnKeyDown
and
def OnKeyDown(self, e):
if e.Key == forms.Keys.Escape:
self.Close(False)
TestDialog.py (1.4 KB)
– Dale
This is exactly what I was looking for. Too noob.