# 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 WPF.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 WPF
- **Section:** Reference
- **Kind:** Property
- **Introduced:** 19.0
- **Namespace:** `TXTextControl.WPF`
- **Package:** `TXTextControl.TextControl.WPF.SDK` (assembly `TXTextControl.WPF.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.WPF.dll` from the setup
- **Path:** TX Text Control .NET for WPF > Reference > TXTextControl.WPF > TextContextMenuEventArgs.TextContextMenu Property
- **507 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontextmenueventargs/textcontextmenu-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontextmenueventargs/textcontextmenu-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/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 [WPF.TextControl](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/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 ContextMenu TextContextMenu { get; set; }
```

```vbnet
Public Property TextContextMenu As ContextMenu
```

### Examples

The following example uses `TextContextMenuEventArgs.TextContextMenu` to configure text context menu as part of the text context menu event args workflow. The configured value is checked before the workflow continues.

```csharp
textContextMenuEventArgs.TextContextMenu = new System.Windows.Controls.ContextMenu();
if (textContextMenuEventArgs.TextContextMenu != null)
{
    Console.WriteLine("Text Context Menu Event Args: Text Context Menu is available.");
}
```

```vbnet
textContextMenuEventArgs.TextContextMenu = New System.Windows.Controls.ContextMenu()
If textContextMenuEventArgs.TextContextMenu IsNot Nothing Then
    Console.WriteLine("Text Context Menu Event Args: Text Context Menu is available.")
End If
```

---

## Nearby

- **Previous:** [TextContextMenuEventArgs.HorizontalOffset Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontextmenueventargs/horizontaloffset-property/llms-full.txt)
- **Next:** [TextContextMenuEventArgs.VerticalOffset Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontextmenueventargs/verticaloffset-property/llms-full.txt)
