Get the SourceControl of a DropDownMenu

The ContextMenuStrip SourceControl (the reference of the current Control where the Context Menu is activated) can be retrieved, from a ToolStripMenuItem, inspecting the OwnerItem reference and moving upstream until the OwnerItem reference is null, then inspecting the Owner value, which references the ContextMenuStrip. (Unfortunately, the SourceControl reference is only available in the ContextMenuStrip control). A … Read more