I have a UserControl
that contains another UserControl
. I'd like the containing control to be able to handle any mouse events that happen over the contained control's area. What's the easiest way to do this?
Changing code for the contained control is possible, but only as a last resort. The contained control has a window that is controlled by an unmanaged library.
FWIW, I have tried adding handlers for the contained control's mouse events, but those handlers never get called. I suspect the contained control is consuming the mouse events.
I've considered adding some sort of transparent window on top of the contained control, to catch the events, but I'm still pretty new to Windows Forms and I'm wondering if there is a better way.