alexa
menu

WinForms

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download

    Show / Hide Table of Contents

    Class ContextMenuHelper

    Provides internal helper methods for managing context menu items across different framework targets.

    Inheritance
    System.Object
    ContextMenuHelper
    Namespace: Syncfusion.Windows.Forms.Chart
    Assembly: Syncfusion.Chart.Windows.dll
    Syntax
    public static class ContextMenuHelper : Object

    Methods

    AddItem(ToolStripItemCollection, String, EventHandler)

    Adds a new item to the specified menu item collection with the given text and event handler.

    Declaration
    public static void AddItem(ToolStripItemCollection menuItemCollection, string text, EventHandler eventHandler)
    Parameters
    Type Name Description
    System.Windows.Forms.ToolStripItemCollection menuItemCollection
    System.String text
    System.EventHandler eventHandler

    AddMenuItem(ToolStripItemCollection, String, EventHandler)

    Adds a new menu item to the specified collection with a text and event handler.

    Declaration
    public static void AddMenuItem(ToolStripItemCollection menuItemCollection, string text, EventHandler eventHandler)
    Parameters
    Type Name Description
    System.Windows.Forms.ToolStripItemCollection menuItemCollection
    System.String text
    System.EventHandler eventHandler

    GetContextMenuItems(ContextMenuStrip)

    Retrieves the collection of menu items from a context menu.

    Declaration
    public static ToolStripItemCollection GetContextMenuItems(ContextMenuStrip contextMenu)
    Parameters
    Type Name Description
    System.Windows.Forms.ContextMenuStrip contextMenu
    Returns
    Type
    System.Windows.Forms.ToolStripItemCollection

    GetIndex(ToolStripMenuItem)

    Retrieves the index of a menu item within its parent collection.

    Declaration
    public static int GetIndex(ToolStripMenuItem menuItem)
    Parameters
    Type Name Description
    System.Windows.Forms.ToolStripMenuItem menuItem
    Returns
    Type
    System.Int32

    GetMenuItems(ToolStripMenuItem)

    Retrieves the collection of child menu items for a given menu item.

    Declaration
    public static ToolStripItemCollection GetMenuItems(ToolStripMenuItem menuItem)
    Parameters
    Type Name Description
    System.Windows.Forms.ToolStripMenuItem menuItem
    Returns
    Type
    System.Windows.Forms.ToolStripItemCollection

    GetParent(ToolStripMenuItem)

    Retrieves the parent menu of a given menu item.

    Declaration
    public static ToolStripItem GetParent(ToolStripMenuItem menuItem)
    Parameters
    Type Name Description
    System.Windows.Forms.ToolStripMenuItem menuItem
    Returns
    Type
    System.Windows.Forms.ToolStripItem
    Back to top Generated by DocFX
    Copyright © 2001 - 2026 Syncfusion Inc. All Rights Reserved