Getting the control that called a Context Menu

  • Thread starter Louis-Pierre Dauphinais
  • 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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top