Getting the control that called a Context Menu

  • Thread starter Thread starter Louis-Pierre Dauphinais
  • Start date Start date
L

Louis-Pierre Dauphinais

To get the control that called a context menu item (ToolStripMenuItem), I
normally do:

itm.Owner.SoucreControl

but what if the menu item is actually in a second level of the context menu?

I can get the ContextMenuStrip using "itm.OwnerItem.Owner"
but for some reason "itm.OwnerItem.Owner.SourceControl" equals Nothing

this doesn't make any sense...

Anyone?
Thanks
 
Back
Top