Class ContextMenuHelper
Provides internal helper methods for managing context menu items across different framework targets.
Inheritance
System.Object
ContextMenuHelper
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Syncfusion.Windows.Forms.Chart
Assembly: Syncfusion.Chart.Windows.dll
Syntax
public static class ContextMenuHelper
Methods
AddItem(Menu.MenuItemCollection, String, EventHandler)
Adds a new item to the specified menu item collection with the given text and event handler.
Declaration
public static void AddItem(Menu.MenuItemCollection menuItemCollection, string text, EventHandler eventHandler)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.Menu.MenuItemCollection | menuItemCollection | |
| System.String | text | |
| System.EventHandler | eventHandler |
AddMenuItem(Menu.MenuItemCollection, String, EventHandler)
Adds a new menu item to the specified collection with a text and event handler.
Declaration
public static void AddMenuItem(Menu.MenuItemCollection menuItemCollection, string text, EventHandler eventHandler)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.Menu.MenuItemCollection | menuItemCollection | |
| System.String | text | |
| System.EventHandler | eventHandler |
GetContextMenuItems(ContextMenu)
Retrieves the collection of menu items from a context menu.
Declaration
public static Menu.MenuItemCollection GetContextMenuItems(ContextMenu contextMenu)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.ContextMenu | contextMenu |
Returns
| Type |
|---|
| System.Windows.Forms.Menu.MenuItemCollection |
GetIndex(MenuItem)
Retrieves the index of a menu item within its parent collection.
Declaration
public static int GetIndex(MenuItem menuItem)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.MenuItem | menuItem |
Returns
| Type |
|---|
| System.Int32 |
GetMenuItems(MenuItem)
Retrieves the collection of child menu items for a given menu item.
Declaration
public static Menu.MenuItemCollection GetMenuItems(MenuItem menuItem)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.MenuItem | menuItem |
Returns
| Type |
|---|
| System.Windows.Forms.Menu.MenuItemCollection |
GetParent(MenuItem)
Retrieves the parent menu of a given menu item.
Declaration
public static Menu GetParent(MenuItem menuItem)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.MenuItem | menuItem |
Returns
| Type |
|---|
| System.Windows.Forms.Menu |