Detecting key pressed on parent/childs MDI forms
-
Hi everyone, i would like to know if there's anyway I can detect a key pressed.:doh: I know there exists the KeyDown and KeyPress events on every control, but i would like to know if theres any way I can detect these events in general, instead of checking these events on all the controls of my application. I'm using a Parent Mdi Form containing lots of child forms, and of course this forms have lots of controls as well. I tried to apply this on the Parent Form's key events, but nothing. I bet there's a simple way to get this done. Please help. Thanks a lot for your time folks. daniel
-
Hi everyone, i would like to know if there's anyway I can detect a key pressed.:doh: I know there exists the KeyDown and KeyPress events on every control, but i would like to know if theres any way I can detect these events in general, instead of checking these events on all the controls of my application. I'm using a Parent Mdi Form containing lots of child forms, and of course this forms have lots of controls as well. I tried to apply this on the Parent Form's key events, but nothing. I bet there's a simple way to get this done. Please help. Thanks a lot for your time folks. daniel
hi daniel, for each form u have a property called kypreview, make this as true and then add keypress or keydown event to that form, so all the key press event come that function first and then goes to corresponding control i hope this will solve ur problem With Regards Amjath
-
hi daniel, for each form u have a property called kypreview, make this as true and then add keypress or keydown event to that form, so all the key press event come that function first and then goes to corresponding control i hope this will solve ur problem With Regards Amjath
-
hi daniel, for each form u have a property called kypreview, make this as true and then add keypress or keydown event to that form, so all the key press event come that function first and then goes to corresponding control i hope this will solve ur problem With Regards Amjath
hey Amjath, perhaps you have little misunderstanding of the question.;) to daniel, I think it's the question about how to bind key events in a simple way. As it mentioned above, there're too many child forms in the parent form, and you don't want to bind the key event in each child form. Thinking of this, if there's a base form called ControlEx (or something else), and it contains the override method of OnKeyPress, OnKeyUp, etc, things will be simpler when all the child forms inheritted from ControlEx not from System.Windows.Froms.UserControl.
--------------------------------- Believe what you saw!