# ContextMenu class

Namespace: [Eto.Forms](https://eto.picoe.ca/api/namespace/eto.forms.md) · Assembly: [Eto](https://eto.picoe.ca/api/assembly/eto.md)

```cs
[ContentProperty("Items")]
[Handler(ContextMenu.IHandler)]
public class ContextMenu : Menu, ISubmenu
```

Represents a context menu that can be shown typically when users right click or press the menu key on a control

## Constructors

- [ContextMenu](https://eto.picoe.ca/api/type/eto.forms.contextmenu/ctor.md): (4 overloads) Initializes a new instance of the [ContextMenu](https://eto.picoe.ca/api/type/eto.forms.contextmenu.md) class.

## Fields

- [ClosedEvent](https://eto.picoe.ca/api/type/eto.forms.contextmenu/closedevent.md): (static) Event identifier for handlers when attaching the [ContextMenu.Closed](https://eto.picoe.ca/api/type/eto.forms.contextmenu/closed.md) event.
- [ClosingEvent](https://eto.picoe.ca/api/type/eto.forms.contextmenu/closingevent.md): (static) Event identifier for handlers when attaching the [ContextMenu.Closing](https://eto.picoe.ca/api/type/eto.forms.contextmenu/closing.md) event.
- [OpeningEvent](https://eto.picoe.ca/api/type/eto.forms.contextmenu/openingevent.md): (static) Event identifier for handlers when attaching the [ContextMenu.Opening](https://eto.picoe.ca/api/type/eto.forms.contextmenu/opening.md) event.

## Properties

- [IncludeSystemItems](https://eto.picoe.ca/api/type/eto.forms.contextmenu/includesystemitems.md): Gets or sets which system items will be automatically included with the menu.
- [Items](https://eto.picoe.ca/api/type/eto.forms.contextmenu/items.md): Gets the menu items in the context menu
- [Trim](https://eto.picoe.ca/api/type/eto.forms.contextmenu/trim.md): Gets a value indicating whether this sub menu should trim its child menu items when loaded onto a form

## Methods

- [GetCallback](https://eto.picoe.ca/api/type/eto.forms.contextmenu/getcallback.md): Gets an instance of an object used to perform callbacks to the widget from handler implementations
- [OnClosed](https://eto.picoe.ca/api/type/eto.forms.contextmenu/onclosed.md): Raises the [ContextMenu.Closed](https://eto.picoe.ca/api/type/eto.forms.contextmenu/closed.md) event.
- [OnClosing](https://eto.picoe.ca/api/type/eto.forms.contextmenu/onclosing.md): Raises the [ContextMenu.Closing](https://eto.picoe.ca/api/type/eto.forms.contextmenu/closing.md) event.
- [OnLoad](https://eto.picoe.ca/api/type/eto.forms.contextmenu/onload.md): Called when the menu is assigned to a control/window
- [OnOpening](https://eto.picoe.ca/api/type/eto.forms.contextmenu/onopening.md): Raises the [ContextMenu.Opening](https://eto.picoe.ca/api/type/eto.forms.contextmenu/opening.md) event.
- [OnUnLoad](https://eto.picoe.ca/api/type/eto.forms.contextmenu/onunload.md): Called when the menu is removed from a control/window
- [Show](https://eto.picoe.ca/api/type/eto.forms.contextmenu/show.md): (4 overloads) Show the context menu at the current mouse position.

## Events

- [Closed](https://eto.picoe.ca/api/type/eto.forms.contextmenu/closed.md): Occurs when the context menu is closed/dismissed, after the menu item has been selected and its click event is triggered.
- [Closing](https://eto.picoe.ca/api/type/eto.forms.contextmenu/closing.md): Occurs before the context menu is closed/dismissed when the user clicks an item, but before the menu item's click event is triggered.
- [Opening](https://eto.picoe.ca/api/type/eto.forms.contextmenu/opening.md): Occurs when the context menu is opening, before it is shown.

## Inherited Members

- From [Menu](https://eto.picoe.ca/api/type/eto.forms.menu.md): [OnPreLoad](https://eto.picoe.ca/api/type/eto.forms.menu/onpreload.md)
- From [BindableWidget](https://eto.picoe.ca/api/type/eto.forms.bindablewidget.md): [Bindings](https://eto.picoe.ca/api/type/eto.forms.bindablewidget/bindings.md), [DataContext](https://eto.picoe.ca/api/type/eto.forms.bindablewidget/datacontext.md), [IsDataContextChanging](https://eto.picoe.ca/api/type/eto.forms.bindablewidget/isdatacontextchanging.md), [Parent](https://eto.picoe.ca/api/type/eto.forms.bindablewidget/parent.md), [Parents](https://eto.picoe.ca/api/type/eto.forms.bindablewidget/parents.md), [DataContextChanged](https://eto.picoe.ca/api/type/eto.forms.bindablewidget/datacontextchanged.md), [FindParent](https://eto.picoe.ca/api/type/eto.forms.bindablewidget/findparent.md), [OnDataContextChanged](https://eto.picoe.ca/api/type/eto.forms.bindablewidget/ondatacontextchanged.md), [Unbind](https://eto.picoe.ca/api/type/eto.forms.bindablewidget/unbind.md), [UpdateBindings](https://eto.picoe.ca/api/type/eto.forms.bindablewidget/updatebindings.md)
- From [Widget](https://eto.picoe.ca/api/type/eto.widget.md): [ControlObject](https://eto.picoe.ca/api/type/eto.widget/controlobject.md), [Handler](https://eto.picoe.ca/api/type/eto.widget/handler.md), [ID](https://eto.picoe.ca/api/type/eto.widget/id.md), [IsDisposed](https://eto.picoe.ca/api/type/eto.widget/isdisposed.md), [NativeHandle](https://eto.picoe.ca/api/type/eto.widget/nativehandle.md), [Platform](https://eto.picoe.ca/api/type/eto.widget/platform.md), [Properties](https://eto.picoe.ca/api/type/eto.widget/properties.md), [Style](https://eto.picoe.ca/api/type/eto.widget/style.md), [StyleChanged](https://eto.picoe.ca/api/type/eto.widget/stylechanged.md), [Dispose](https://eto.picoe.ca/api/type/eto.widget/dispose.md), [Initialize](https://eto.picoe.ca/api/type/eto.widget/initialize.md), [OnStyleChanged](https://eto.picoe.ca/api/type/eto.widget/onstylechanged.md), [ToString](https://eto.picoe.ca/api/type/eto.widget/tostring.md)
