I have a ContextMenu assigned to two ListViews. How to know which ListView it was used with so I can apply correct method? I guess sender is important here but how do I use it? How to know what sender is at this very moment?
private void contextMenuDokumentyDodaj_Click(object sender, EventArgs e) {
var dokumenty = new DocumentsGui(varKlienciID, varPortfelID);
dokumenty.Show();
dokumenty.FormClosed += varDocumentsGui_FormClosed;
}
is your ticket.
http://msdn.microsoft.com/en-us/library/system.windows.forms.contextmenu.sourcecontrol.aspx
EDIT
ContextMenuStrip, you say?
http://msdn.microsoft.com/en-us/library/system.windows.forms.contextmenustrip.sourcecontrol.aspx