contextmenustrip如何判断是哪个item触发的事件
是不是这个意思
void tools_Click(object sender, EventArgs e)
{
MessageBox.Show((sender as ToolStripMenuItem).Text);
}
private void Form1_Load(object sender, EventArgs e)
{
ContextMenuStrip context = new ContextMenuStrip();
for (int i = 0; i < 5; i++)
{
ToolStripMenuItem tools = new ToolStripMenuItem(i.ToString("F5"));
tools.Click += new EventHandler(tools_Click);
context.Items.Add(tools);
}
pictureBox1.ContextMenuStrip = context;
}