# TextContextMenuEventArgs Class

> The TextContextMenuEventArgs class provides data for the ServerVisualization.TextViewGenerator.TextContextMenuOpening event. It provides an array of menu items for a certain location in a document. The ContextMenuLocation property informs for which part of the document the items have been generated.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Class
- **Introduced:** 21.0
- **Namespace:** `TXTextControl.ServerVisualisation`
- **Package:** `TXTextControl.TextControl.Core.SDK` (assembly `TXTextControl.Server.Core.dll`, from the private NuGet feed or Text Control Offline Packages)
- **Package:** `TXTextControl.TextControl.ASP.SDK` (assembly `TXTextControl.Server.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.Server.dll` from the setup
- **Inherits:** `System.EventArgs`
- **Path:** TX Text Control .NET Server > Reference > TXTextControl.ServerVisualization > TextContextMenuEventArgs Class
- **731 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textcontextmenueventargs/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textcontextmenueventargs/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textcontextmenueventargs/llms-full.txt

---

### Description

The TextContextMenuEventArgs class provides data for the [ServerVisualization.TextViewGenerator.TextContextMenuOpening](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/textcontextmenuopening-event/llms-full.txt) event. It provides an array of menu items for a certain location in a document. The [ContextMenuLocation](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textcontextmenueventargs/contextmenulocation-property/llms-full.txt) property informs for which part of the document the items have been generated.

### Syntax

```csharp
public class TextContextMenuEventArgs : EventArgs
```

```vbnet
Public Class TextContextMenuEventArgs
    Inherits EventArgs
```

### Examples

The following example includes the context menu location value from a Text Context Menu Event Args object in application diagnostics. The created object is then available to the surrounding document workflow.

```csharp
Console.WriteLine($"Context Menu Location: {textContextMenuEventArgs.ContextMenuLocation}");
Console.WriteLine("Text Context Menu Event Args is ready for use.");
```

```vbnet
Console.WriteLine($"Context Menu Location: {textContextMenuEventArgs.ContextMenuLocation}")
Console.WriteLine("Text Context Menu Event Args is ready for use.")
```

---

## In This Section

- [TextContextMenuEventArgs.ContextMenuLocation Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textcontextmenueventargs/contextmenulocation-property/llms-full.txt): Gets the location in the document for which the menu items have been generated. The generated items depend on this location. The property value can be a combination (bitwise or) of the ContextMenuLocation values.
- [TextContextMenuEventArgs.Items Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textcontextmenueventargs/items-property/llms-full.txt): Gets an array of ServerVisualization.MenuItem objects. These objects contain all data necessary to display a context menu.
- [TextContextMenuEventArgs.Location Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textcontextmenueventargs/location-property/llms-full.txt): Gets the location, in pixels, where the context menu should be displayed. The coordinates are relative to the top-left corner of the screen.
- [TextContextMenuEventArgs.RightToLeft Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textcontextmenueventargs/righttoleft-property/llms-full.txt): Gets a value indicating whether the context menu must be shown from right to left.

---

## Nearby

- **Previous:** [StatusBarViewGenerator.View Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/statusbarviewgenerator/view-property/llms-full.txt)
- **Next:** [TextContextMenuEventArgs.ContextMenuLocation Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textcontextmenueventargs/contextmenulocation-property/llms-full.txt)
