Zedgraph Right-click menu How to disable it pop-up

Source: Internet
Author: User

private void Zgc_contextmenubuilder (Zedgraphcontrol sender,
ContextMenuStrip MenuStrip, point mousept,
Zedgraphcontrol.contextmenuobjectstate objstate)
{
Try
{
#region//Remove unused keys

Remove the other menu options to change the Set_default to the corresponding string.
Title_def Title
Copy replication
Copied_to_clip Copy to Clipboard
Page_setup Page Setup ...
Print printing ...
Save_as Save Chart ...
Set_default Restore Default Size
Show_val Display node values

Unzoom Restore Zoom
UNPAN Restore Mobile
Undo_all Restore Zoom/move

X_title_def X-axis
Y_title_def Y-axis

Each loop can only traverse one key
foreach (ToolStripMenuItem item in Menustrip.items)
{
if (string) item. Tag = = "Set_default")//"Restore Default Size" menu item
{
MenuStrip.Items.Remove (item);//Remove menu item
Item. Visible = false; does not display
Break
}
}
foreach (ToolStripMenuItem item in Menustrip.items)
{
if (string) item. Tag = = "Copy")//"Copy" menu item
{
MenuStrip.Items.Remove (item);//Remove menu item
Item. Visible = false; does not display
Break
}
}
foreach (ToolStripMenuItem item in Menustrip.items)
{
if (string) item. Tag = = "Page_setup")//"Page Setup" menu item
{
MenuStrip.Items.Remove (item);//Remove menu item
Item. Visible = false; does not display
Break
}
}
foreach (ToolStripMenuItem item in Menustrip.items)
{
if (string) item. Tag = = "print")//"Printing" menu item
{
MenuStrip.Items.Remove (item);//Remove menu item
Item. Visible = false; does not display
Break
}
}
foreach (ToolStripMenuItem item in Menustrip.items)
{
if (string) item. Tag = = "Save_as")//"Save as" menu item
{
MenuStrip.Items.Remove (item);//Remove menu item
Item. Visible = false; does not display
Break
}
}
#endregion
}
catch (System.Exception ex)
{
MessageBox.Show ("Error code:112, Initialize right-click menu errors" + ex.) ToString ());
}
}
#endregion

* * If you do not need to display at all, use Zedcntrol.isshowcontextmenu = false;

Zedgraph Right-click menu How to disable it pop-up (go)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.