G
Guest
Hi,
I am trying to trace down the Enter key in my Form.KeyPress event handler.
The KeyPreview property is set to false, so I'd assume that all key presses
should go through my form's KeyPress event handler, right? Ok. If the focus
is set to any other control than a button, then the above event handler
fires, but if the focus is on a button, then I've no way to know that the
Enter key has been pressed or not, because in that case pressing Enter
doesn't fire KeyPress event of the Form. My question is Why?
Thanks for your help,
I am trying to trace down the Enter key in my Form.KeyPress event handler.
The KeyPreview property is set to false, so I'd assume that all key presses
should go through my form's KeyPress event handler, right? Ok. If the focus
is set to any other control than a button, then the above event handler
fires, but if the focus is on a button, then I've no way to know that the
Enter key has been pressed or not, because in that case pressing Enter
doesn't fire KeyPress event of the Form. My question is Why?
Thanks for your help,