ContextMenu Variable Click Event
I use this code to add an item to the contextmenustrip:
contextMenuStrip1.Items.Add(myitemlist);
On the click of items, how to assign the event?
Ex item1click = messagebox.show("item clicked1")
item2click = messagebox.show("item clicked2");
Is it possibile or is it a waste of time?
Edit:
In this mode
private void contextMenuStrip1_ItemAdded(object sender,
ToolStripItemEventArgs e)
{
e.Item.Click += new EventHandler(button3_Click);
}
All items have the same event.
No comments:
Post a Comment