I
Ian Williamson
Greetings,
I have a custom control which I am adding to a form. It
processes Key events, but if the event is not handled at
this control's level, then it needs to pass the event up
to the containing form.
Currently I am making a call similar to:
((MyForm)((Control)sender).TopLevelControl).MyForm_KeyUp
(sender, e);
I find this a rather nasty way to approach this as it
ruins encapsulation for my control since it needs
explicit knowledge of the form that it will be contained
in.
Is there is a better way to throw this event to the
parent form?
Cheers, Ian Williamson
I have a custom control which I am adding to a form. It
processes Key events, but if the event is not handled at
this control's level, then it needs to pass the event up
to the containing form.
Currently I am making a call similar to:
((MyForm)((Control)sender).TopLevelControl).MyForm_KeyUp
(sender, e);
I find this a rather nasty way to approach this as it
ruins encapsulation for my control since it needs
explicit knowledge of the form that it will be contained
in.
Is there is a better way to throw this event to the
parent form?
Cheers, Ian Williamson