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?
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?
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);
}