How to respond to a ContextMenuStrip item click

后端 未结 2 716
别那么骄傲
别那么骄傲 2021-01-07 17:45

Currently I have the following code:

ContextMenuStrip contexMenuuu = new ContextMenuStrip();

contexMenuuu.Items.Add(\"Edit \");
contexMenuuu.Items.Add(\"Del         


        
2条回答
  •  执念已碎
    2021-01-07 18:08

    Add method returns ToolStripItem. So you can add handle to Click event

            var item = contexMenuuu.Items.Add("Edit ");
            item.Click += methodToBeInvoked;
    

提交回复
热议问题