key press to form only; not child controls
Posted on 2004-04-03
I have a form with child controls. When the form opens, one of the child controls (a radio button) gets focus. Then when I press the up/down arrow keys, a radio button group selection changes.
What I want is for the form to always get the key press events and I dont ever want the child controls to get a key press event. I tried over-riding the OnKeyDown method, but since a child control on the form has focus, it gets the key press event and not the parent form.
How can I cause the parent form to get all key press events and stop them from being propigated to the child controls? The user still needs to interact with the controls (sliders, radio button, etc), but even if a slider has focus, if the user presses a key, I want the parent form to get this event and cosume it and not let the slider get it.