
KeyDown Event of Form Not working when Datacombo Control got focus
Hi
I have encountered a problem for handling event.
In an application, I want to make the open form to be closed by pressing the
ESC key. So I have written some event handling code that
make use of the Keydown event of the form to check if the keycode is equal
to 27 (Esc key) and then unload the form. I have set
the KeyPreview property of the form to true. However if there is a combo box
on the form and it got the focus, the event will not be fired.
I have tried another way to implement the behavior by just setting the
cancel property of a cancel button to true. The result is the same.
Can anyone know the proper way to handling this or there is another way to
implement this behavior ?
Thanks a lot
Ivan