Posted on 2006-07-21
Here is the situation: Usually, we use quite a lot of FORMS in a Delphi application. MainForm, DialogForm, SomeForm, etc.
In each form, we put several objects, TEdit, TListBox, TComboBox, TCheckbox, etc.
What is the best way to catch the ESC key for "closing" a form ?
I know that we can catch it in the "KeyDown" event.
But it will be too much for catching this in every object's event.
Because I tried to set in the TForm OnKeyDown, it will not work if the focus is in TEdit.
Anyone know a trick for this ?
One catch function per-TForm is ok tough.