How can I get ContextMenu that a ToolStripDropDownItem belongs to? This is for the purpose of using the ContextMenu.SourceControl as the logical sender to an event.
How can I get ContextMenu that a ToolStripDropDownItem belongs to? This is for the
Share
`ToolStripItem.OwnerItem`
[http://msdn.microsoft.com/en-us/library/system.windows.forms.toolstripitem.owneritem.aspx][1]
That property can be used to walk up the tree of menu items to the top level item… Isn’t what you are after just the
Ownerproperty of the menu?Obviously use
asetc and do your null checks…If I am missing the spot perhaps post a code snippet of the menu built via code to clarify the types (ContextMenu vs ContextMenuStrip etc)
PK 🙂