C#, WinForms: What would prevent KeyDown events from chaining up from focused control up to main Form? Only leaf controls KeyDown works for me -
As I understand when a keyboard button is pressed, the keyown event should be invited for that control After that, the keydown to the main control, so far and beyond until it does not reach the main form. Unknowingly - an event handlers with the series did:
e.SuppressKeyPress = true; E.Handled = True;
In my case, the incidents of keydowns are never met mainly. For example, I have a form -> panel -> button.
The panel does not offer keydown events, but should not stop it from reaching the main form?
As a work, I have written that I set every control to call an event handler. I'm basically trying to stop Alt-F4 from closing the application and instead of reducing it,
[edit]
If you want to trap Alt-F4, then there is no one trying at the control level because that keystroke is controlled by the application -
Comments
Post a Comment