# CaretStateEventArgs Class

> The CaretStateEventArgs class provides data about the state of the caret, such as position, size and visibility. It is used with the CaretStateChanged event of the ServerVisualization.TextViewGenerator and the ServerVisualization.DialogViewGenerator class.

- **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 > CaretStateEventArgs Class
- **630 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/caretstateeventargs/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/caretstateeventargs/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/caretstateeventargs/llms-full.txt

---

### Description

The CaretStateEventArgs class provides data about the state of the caret, such as position, size and visibility. It is used with the [CaretStateChanged](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/dialogviewgenerator/caretstatechanged-event/llms-full.txt) event of the [ServerVisualization.TextViewGenerator](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/llms-full.txt) and the [ServerVisualization.DialogViewGenerator](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/dialogviewgenerator/llms-full.txt) class.

### Syntax

```csharp
public class CaretStateEventArgs : EventArgs
```

```vbnet
Public Class CaretStateEventArgs
    Inherits EventArgs
```

### Examples

The following example includes the location value from a Caret State Event Args object in application diagnostics. The created object is then available to the surrounding document workflow.

```csharp
Console.WriteLine($"Location: {caretStateEventArgs.Location}");
Console.WriteLine("Caret State Event Args is ready for use.");
```

```vbnet
Console.WriteLine($"Location: {caretStateEventArgs.Location}")
Console.WriteLine("Caret State Event Args is ready for use.")
```

---

## In This Section

- [CaretStateEventArgs.Direction Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/caretstateeventargs/direction-property/llms-full.txt): Gets the caret's direction.
- [CaretStateEventArgs.Location Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/caretstateeventargs/location-property/llms-full.txt): Gets the caret's location in pixels.
- [CaretStateEventArgs.Size Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/caretstateeventargs/size-property/llms-full.txt): Gets the caret's visibility.
- [CaretStateEventArgs.Visibility Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/caretstateeventargs/visibility-property/llms-full.txt): Gets the caret's visibility.

---

## Nearby

- **Previous:** [TXTextControl.ServerVisualization namespace](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/llms-full.txt)
- **Next:** [CaretStateEventArgs.Direction Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/caretstateeventargs/direction-property/llms-full.txt)
