I have a User Control which I've placed a FlowControlPanel on, then some other controls. Now I've probably assumed to much in expecting events that happen to the child controls, will also be sent for processing at the User Control level. Such as when someone clicks on the label that is in the control, not just the Click event on the label should fire, but the Click event on the User Control should fire as well.
I mean not only was the label clicked, but so was my user control. Maybe I'm missing something, maybe I've been entering the wrong search criteria, but is there anyway to get the events of the child controls to fire the User Controls events?
As far as I know, there's no way to do this except via a mouse hook (which may be overkill for this). Instead you could handle the child's
Click event in the
UserControl class (which should basically give you the same flexibility).
Windows Forms does not support the idea of event bubbling, but you can always add an event to your UserControl, route all mouse click events for the child controls to a single event handler, and then fire the event.
Why do you want the click event for the
UserControl to fire. Instead, make all of its child controls public so the hosting form can hook their events.
You can, of course do what you want by using interopservices and forcing a mouse click event, but the click event is the only event that would make sense, and I don't think you really want that.
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)