-1

I'm having a ContextMenu, and I need to determine what control has it been opened on in the event ContextMenu_Opening.

The event arguments do not contain such information, or either the sender. How can I do that?

vfioox
  • 730
  • 1
  • 8
  • 22

1 Answers1

0

Solved by using a simple property which I had no idea it existed..:

private void contextMenu1_Opening(object sender, CancelEventArgs e)
{
     MessageBox.Show(contextMenu1.SourceControl.Name);
}
vfioox
  • 730
  • 1
  • 8
  • 22