Passing Events to child objects

Cags

Contributor
Joined
Feb 19, 2004
Messages
695
Location
Melton Mowbray, England
I have an application for Pocket PC that allows user input through the hardware keys. My form has a single control on it, which in turn has several controls on. As far as I can work out pressing the hardware keys always triggers the KeyEvents of the main form, not the child (at least it has in all my tests). In order to keep my application segmented I want the control to handle these events. The way I'm doing it currently is to add a public method to the control which accepts the KeyEventArgs as a paramter and then just call this method from the forms KeyEvent (one method for each keyevent I wish to use i.e KeyDown, KeyPress etc etc). Is this the best way forward or am I missing a more OOP method.
 
Back
Top