I have a few listview controls on a windows form and i've assigned a common contextmenustrip to them all using the properties grid in VS2005.
Now when a selection is made from the contextmenu in any listview, is there a way i can get the correct hosting control of the raised menu?
A ContextMenu is attached to a specific control. The ContextMenu element enables you to present users with a list of items that specify commands or options that are associated with a particular control, for example, a Button. Users right-click the control to make the menu appear.
The ContextMenu class represents shortcut menus that can be displayed when the user clicks the right mouse button over a control or area of the form. Shortcut menus are typically used to combine different menu items from a MainMenu of a form that are useful for the user given the context of the application.
ContextMenuStrip.SourceControl
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With