rfresh
Active member
- Joined
- Aug 23, 2012
- Messages
- 26
- Programming Experience
- 1-3
My menu code fires the menu click event but the menuItem.Name is always ""
Obviously my code isn't setup right.
Thanks for any help.
Obviously my code isn't setup right.
Thanks for any help.
C#:
ContextMenuStrip menuStrip = new ContextMenuStrip();
ToolStripMenuItem menuItem = new ToolStripMenuItem();
menuStrip.Items.Add("1111");
menuStrip.Items.Add("2222");
menuItem.Click += new EventHandler(menuItem_Click);
panelMenu.ContextMenuStrip = menuStrip;
void menuItem_Click(object sender, EventArgs e)
{
ToolStripItem menuItem = (ToolStripItem)sender;
if (menuItem.Name == "1111")
{
}
}