How to remove a specific context menu item in Zedgraph

I want to delete a specific context menu item that appears when the Mouse Down event is triggered (right).

enter image description here

using the Context Menu Builder event, I was able to add some costume menu items, but I want to get rid of the last item (by default).

Thanks in advance...

+7
source share
1 answer

In the same event handler, you can also delete items, for example:

private void zedGraphControl1_ContextMenuBuilder(ZedGraphControl sender, ContextMenuStrip menuStrip, Point mousePt, ZedGraphControl.ContextMenuObjectState objState) { foreach (ToolStripMenuItem item in menuStrip.Items) { if ((string)item.Tag == "set_default") { menuStrip.Items.Remove(item); break; } } } 

Corresponding link: http://goorman.free.fr/ZedGraph/zedgraph.org/wiki/index43d0.html?title=Edit_the_Context_Menu

+6
source

All Articles