# ContextMenu

The Wisej.NET `ContextMenu` provides right-click shortcut menus for controls or form areas. These menus can combine relevant items from a form's `MainMenu` or introduce new context-specific commands. For example, a `TextBox` control's context menu might offer font changes, text search, and clipboard operations.

Controls and forms expose a `ContextMenu` property for binding the menu. Multiple controls can share one `ContextMenu`. Use the `SourceControl` property to identify which control triggered the menu for control-specific actions or menu modifications.

Handle the `Popup` event to modify menu items (set check marks, disable items) before display.

{% hint style="info" %}
For a full list of properties, methods and events see the [API documentation.](http://docs.wisej.com/api)
{% endhint %}

## Features

### Reusable

The `ContextMenu` can be assigned to any control supporting the `ContextMenu` property.

![ContextMenu assigned to multiple controls](https://553579532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MF1D11gPs_az3xaKusw%2Fuploads%2Fgit-blob-87b3c74151399ff0f237fc441a1605962da35e00%2Fimage.png?alt=media)

One `ContextMenu` instance serves both `Button` and `ComboBox` controls.

![ContextMenu showing shared instance](https://553579532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MF1D11gPs_az3xaKusw%2Fuploads%2Fgit-blob-176ad98d1d56a93339c9afd60fa69494f70ebc68%2Fimage.png?alt=media)

## Advanced

### JavaScript Widget

| Item             | Description                                                                                                         |
| ---------------- | ------------------------------------------------------------------------------------------------------------------- |
| Class name       | "wisej.web.menu.ContextMenu"                                                                                        |
| Theme appearance | "item", see [Themes](https://docs.wisej.com/theme-builder/theme-elements/elements)                                  |
| Child components | "icon" is the item's icon, if applicable. "shortcut" is the item's shortcut. "arrow" is the `>` arrow icon          |
| Source code      | [https://github.com/iceteagroup/wisej-js](https://github.com/iceteagroup/wisej-js/blob/master/wisej.web.TextBox.js) |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wisej.com/docs/controls/menus/contextmenu.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
