alexa
menu

WinForms

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

    Show / Hide Table of Contents

    Class StandardMenusProvider

    The StandardMenusProvider class implements the IContextMenuProvider interface and serves as the menu provider for the standard .NET context menus. Controls that have a StandardMenusProvider object set as their menu provider will display a instance. IContextMenuProvider

    Inheritance
    System.Object
    StandardMenusProvider
    Implements
    IContextMenuProvider
    Namespace: Syncfusion.Windows.Forms
    Assembly: Syncfusion.Shared.Base.dll
    Syntax
    public class StandardMenusProvider : Object, IContextMenuProvider

    Constructors

    StandardMenusProvider()

    Creates an instance of the StandardMenusProvider class.

    Declaration
    public StandardMenusProvider()

    Fields

    cntxtMenu

    Declaration
    protected ContextMenuStrip cntxtMenu
    Field Value
    Type
    System.Windows.Forms.ContextMenuStrip

    handlerMap

    Declaration
    protected Hashtable handlerMap
    Field Value
    Type
    System.Collections.Hashtable

    m_bNeedAddRemoveButton

    Declaration
    protected bool m_bNeedAddRemoveButton
    Field Value
    Type
    System.Boolean

    Methods

    AddContextMenuItem(String, EventHandler)

    Overridden. See AddContextMenuItem(String, EventHandler).

    Declaration
    public void AddContextMenuItem(string itemtext, EventHandler handler)
    Parameters
    Type Name Description
    System.String itemtext
    System.EventHandler handler

    AddContextMenuItem(String, String, EventHandler)

    Overridden. See AddContextMenuItem(String, String, EventHandler).

    Declaration
    public void AddContextMenuItem(string parentitemtext, string itemtext, EventHandler handler)
    Parameters
    Type Name Description
    System.String parentitemtext
    System.String itemtext
    System.EventHandler handler

    Clear()

    Clears all menu items.

    Declaration
    public void Clear()

    ContextMenuCommandHandler(Object, EventArgs)

    Declaration
    protected void ContextMenuCommandHandler(object sender, EventArgs args)
    Parameters
    Type Name Description
    System.Object sender
    System.EventArgs args

    DisposeContextMenu()

    Overridden. See DisposeContextMenu().

    Declaration
    public void DisposeContextMenu()

    GetContextMenuItemChecked(String)

    Overridden. See GetContextMenuItemChecked(String).

    Declaration
    public bool GetContextMenuItemChecked(string itemtext)
    Parameters
    Type Name Description
    System.String itemtext
    Returns
    Type
    System.Boolean

    GetContextMenuItemEnabled(String)

    Overridden. See GetContextMenuItemEnabled(String).

    Declaration
    public bool GetContextMenuItemEnabled(string itemtext)
    Parameters
    Type Name Description
    System.String itemtext
    Returns
    Type
    System.Boolean

    GetContextMenuItemShortcut(String)

    Overridden. See GetContextMenuItemShortcut(String).

    Declaration
    public Shortcut GetContextMenuItemShortcut(string itemtext)
    Parameters
    Type Name Description
    System.String itemtext
    Returns
    Type
    System.Windows.Forms.Shortcut

    GetItemsCount()

    Gets the ContextMenu items Count.

    Declaration
    public int GetItemsCount()
    Returns
    Type
    System.Int32

    InitializeContextMenu()

    Overridden. See InitializeContextMenu().

    Declaration
    public void InitializeContextMenu()

    NeedAddRemoveButtons()

    Indicates whether "Add or Remove buttons" is needed.

    Declaration
    public bool NeedAddRemoveButtons()
    Returns
    Type
    System.Boolean

    RecurseDisposeMenuItems(ToolStripItemCollection)

    Declaration
    protected void RecurseDisposeMenuItems(ToolStripItemCollection collection)
    Parameters
    Type Name Description
    System.Windows.Forms.ToolStripItemCollection collection

    RecurseGetMenuItem(ToolStripItemCollection, String)

    Declaration
    protected ToolStripMenuItem RecurseGetMenuItem(ToolStripItemCollection collection, string itemtext)
    Parameters
    Type Name Description
    System.Windows.Forms.ToolStripItemCollection collection
    System.String itemtext
    Returns
    Type
    System.Windows.Forms.ToolStripMenuItem

    RecurseGetParentCollection(ToolStripItemCollection, String)

    Declaration
    protected ToolStripItemCollection RecurseGetParentCollection(ToolStripItemCollection collection, string itemtext)
    Parameters
    Type Name Description
    System.Windows.Forms.ToolStripItemCollection collection
    System.String itemtext
    Returns
    Type
    System.Windows.Forms.ToolStripItemCollection

    RemoveContextMenuItem(String)

    Overridden. See RemoveContextMenuItem(String).

    Declaration
    public void RemoveContextMenuItem(string itemtext)
    Parameters
    Type Name Description
    System.String itemtext

    SetContextMenuItemChecked(String, Boolean)

    Overridden. See SetContextMenuItemChecked(String, Boolean).

    Declaration
    public void SetContextMenuItemChecked(string itemtext, bool bchecked)
    Parameters
    Type Name Description
    System.String itemtext
    System.Boolean bchecked

    SetContextMenuItemEnabled(String, Boolean)

    Overridden. See SetContextMenuItemEnabled(String, Boolean).

    Declaration
    public void SetContextMenuItemEnabled(string itemtext, bool benabled)
    Parameters
    Type Name Description
    System.String itemtext
    System.Boolean benabled

    SetContextMenuItemImage(String, ImageList, Int32)

    Overridden. See SetContextMenuItemImage(String, ImageList, Int32).

    Declaration
    public void SetContextMenuItemImage(string itemtext, ImageList list, int index)
    Parameters
    Type Name Description
    System.String itemtext
    System.Windows.Forms.ImageList list
    System.Int32 index

    SetContextMenuItemSeparator(String, Boolean)

    Overridden. See SetContextMenuItemSeparator(String, Boolean).

    Declaration
    public void SetContextMenuItemSeparator(string itemtext, bool binsertseparator)
    Parameters
    Type Name Description
    System.String itemtext
    System.Boolean binsertseparator

    SetContextMenuItemShortcut(String, Shortcut)

    Overridden. See SetContextMenuItemShortcut(String, Shortcut).

    Declaration
    public void SetContextMenuItemShortcut(string itemtext, Shortcut key)
    Parameters
    Type Name Description
    System.String itemtext
    System.Windows.Forms.Shortcut key

    SetVisualStyle(VisualStyle)

    Overridden. See SetVisualStyle(VisualStyle).

    Declaration
    public void SetVisualStyle(VisualStyle style)
    Parameters
    Type Name Description
    VisualStyle style

    ShowContextMenu(Control, Point)

    Overridden. See ShowContextMenu(Control, Point).

    Declaration
    public void ShowContextMenu(Control owner, Point pt)
    Parameters
    Type Name Description
    System.Windows.Forms.Control owner
    System.Drawing.Point pt

    Events

    Closing

    Occurs when menu is collapsed.

    Declaration
    public event ToolStripDropDownClosingEventHandler Closing
    Event Type
    Type
    System.Windows.Forms.ToolStripDropDownClosingEventHandler

    Opening

    Occurs when menu is popped up.

    Declaration
    public event CancelEventHandler Opening
    Event Type
    Type
    System.ComponentModel.CancelEventHandler

    Implements

    IContextMenuProvider
    Back to top Generated by DocFX
    Copyright © 2001 - 2026 Syncfusion Inc. All Rights Reserved