简体   繁体   English

如何在Zedgraph中删除特定的上下文菜单项

[英]How to remove a specific context menu item in Zedgraph

I want to remove a specific context menu item, appears when the Mouse down(right) event is fired. 我要删除特定的上下文菜单项,该事件在触发Mouse down(right)事件时出现。

在此处输入图片说明

with the help of Context Menu Builder event, I was able to add some costume menu items, but I want to get rid off the last item(Default). 在上下文菜单生成器事件的帮助下,我能够添加一些服装菜单项,但是我想摆脱最后一项(默认)。

Thanks in advance... 提前致谢...

In the same event handler, you can remove items as well, 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;
    }
  }
}

Relevant Link: http://goorman.free.fr/ZedGraph/zedgraph.org/wiki/index43d0.html?title=Edit_the_Context_Menu 相关链接: http : //goorman.free.fr/ZedGraph/zedgraph.org/wiki/index43d0.html?title=Edit_the_Context_Menu

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM