# TextContextMenuEventArgs.TextContextMenu Property

> Gets or sets the context menu, which will be shown. The items depend on the document location where the mouse click occurs. The menu can be altered, extended or completely replaced. When this property is set to null, the TextControl uses system menu items. To completely suppress a context menu, the Cancel Property must be set the true.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Property
- **Introduced:** 19.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WinForms.SDK` (assembly `TXTextControl.Windows.Forms.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.Windows.Forms.dll` from the setup
- **Path:** TX Text Control .NET for Windows Forms > Reference > TXTextControl > TextContextMenuEventArgs.TextContextMenu Property
- **392 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontextmenueventargs/textcontextmenu-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontextmenueventargs/textcontextmenu-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontextmenueventargs/textcontextmenu-property/llms-full.txt

---

### Description

Gets or sets the context menu, which will be shown. The items depend on the document location where the mouse click occurs. The menu can be altered, extended or completely replaced. When this property is set to null, the [TextControl](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/llms-full.txt) uses system menu items. To completely suppress a context menu, the `Cancel` Property must be set the true.

### Syntax

```csharp
public ContextMenuStrip TextContextMenu { get; set; }
```

```vbnet
Public Property TextContextMenu As ContextMenuStrip
```

### Examples

The following example uses `TextContextMenuEventArgs.TextContextMenu` while handling `TextContextMenuOpening`.

```csharp
textControl.TextContextMenuOpening += (_, e) =>
{
    e.TextContextMenu?.Select();
};
```

```vbnet
AddHandler textControl.TextContextMenuOpening,
    Sub(sender, e)
        If e.TextContextMenu IsNot Nothing Then e.TextContextMenu.Select()
    End Sub
```

---

## Nearby

- **Previous:** [TextContextMenuEventArgs.Location Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontextmenueventargs/location-property/llms-full.txt)
- **Next:** [TextControl Class](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/llms-full.txt)
