All pastes #59440 Raw Edit

Mine

public text v1 · immutable
#59440 ·published 2006-05-28 22:51 UTC
rendered paste body
.. i have the following code adding menu items dynamically ...

if (menuItemExists == false)
{
   this.parentForm.menuCachedDicomMedia.MenuItems.Add(this.dicomDirRootDirectory, new System.EventHandler(parentForm.CachedDicomDirSelected));
   this.parentForm.hashDicomDirs.Add(this.dicomDirRootDirectory, instanceValue);
}

.. when one of those items is clicked it ends up going into the method below ..

public void CachedDicomDirSelected(object sender, System.EventArgs e)
{
   DD = new Dicomdir(this.replicatorPath, this.dicomDirView, this);
}

.. my problem is that i cant figure out how to identify the text value or even which item was actually clicked in the menu using the e object or the sender object .. what can i do? id like to grab the string text value of the item that was clicked in this generic method..