'Passing events to the parent panel
In a Windows Forms application, I want to create a UserControl
that reacts to mouse events. But in some cases, I want the event to be passed to the parent that holds it (a Panel
for instance). In particular, I want a Shift+MouseClick
to be passed to the parent to let a context menu appear (the context menu may not be embedded in the UserControl
). But a plain MouseClick
will be not be transmitted.
Is there a simple way to achieve that (preferably using a standard MouseClick
event handled by the Panel
) ?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|