Class ContextMenuManager
Represents a class that implements ContextMenu that enables the user to edit the contents and open or create a new file.
Inheritance
Implements
Inherited Members
Namespace: Syncfusion.Windows.Forms.Edit.Implementation
Assembly: Syncfusion.Edit.Windows.dll
Syntax
public class ContextMenuManager : IDisposable
Constructors
ContextMenuManager(Control)
Initializes a new instance of the ContextMenuManager class.
Declaration
public ContextMenuManager(Control parent)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.Control | parent | Control, context menu should be attached to. |
Properties
ContextMenuProvider
Gets the IContextMenuProvider interface that provides Essential Suite controls with a high-level API for creating and working with context menus. Subscribing to this interface allows the Essential Suite controls to seamlessly switch between the standard .NET System.Windows.Forms.ContextMenu and the Syncfusion.Windows.Forms.Tools.XPMenus.PopupMenu classes depending on the whether the Essential Tools library is available or not. StandardMenusProvider ContextMenuItem
Declaration
public IContextMenuProvider ContextMenuProvider { get; set; }
Property Value
Type |
---|
IContextMenuProvider |
Enabled
Gets or sets a value indicating whether the context menu is enabled or not in EditControl.
Declaration
public bool Enabled { get; set; }
Property Value
Type |
---|
System.Boolean |
IsShown
Gets or sets a value indicating whether context menu is shown or not.
Declaration
public bool IsShown { get; }
Property Value
Type |
---|
System.Boolean |
IsXPMenusProvider
Gets a value indicating whether the ContextMenuProvider is of XPMenusProvider type or not.
Declaration
public bool IsXPMenusProvider { get; }
Property Value
Type |
---|
System.Boolean |
Methods
AddMenuItem(String, EventHandler)
Adds a new menu item to the context menu item collection.
Declaration
public void AddMenuItem(string name, EventHandler handlerClick)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the menu item. |
System.EventHandler | handlerClick | Handler of the click event of the item. Null if item will have children. |
AddMenuItem(String, EventHandler, Boolean)
Adds a new menu item to the context menu item collection.
Declaration
public void AddMenuItem(string name, EventHandler handlerClick, bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the menu item. |
System.EventHandler | handlerClick | Handler of the click event of the item. |
System.Boolean | enabled | The boolean value for the menu item's Enabled property to be set. |
AddSeparator()
Adds a separator in between menu item.
Declaration
public void AddSeparator()
ClearMenu()
Clears all the context menu items that contains in the ContextMenuProvider.
Declaration
public void ClearMenu()
Dispose()
Disposes all used resources.
Declaration
public void Dispose()
ShowContextMenu()
Initializes context menu and shows it.
Declaration
protected virtual void ShowContextMenu()
Events
FillMenu
Occurs when user fill the menu with menu items.
Declaration
public event EventHandler FillMenu
Event Type
Type |
---|
System.EventHandler |