I am using the new ToolStripMenuItem in .Net 2.0, which replaces MenuItem. MenuItem has an "Index" property, but ToolStripMenuItem does not. Is there a way to determine the index of the currently selected menu item from within a "Click" event?
What I'm trying to accomplish is to remove a menu item when it's clicked, then put this same menu item at the top of the menu (the menu is a Most Recently Used list).
tia,
flynn
What I'm trying to accomplish is to remove a menu item when it's clicked, then put this same menu item at the top of the menu (the menu is a Most Recently Used list).
Code:
private void OnMRUClicked(object sender, EventArgs e)
{
ToolStripItem item = (ToolStripItem)sender;
// remove the menu item from its current location...
mruList.RemoveAt(item.Index); // <--- error, no Index property
// ...and add it to the top of the MRU menu
mruList.Insert(0, mru);
}
tia,
flynn