# CommentEventArgs Class

> The CommentEventArgs class provides data for the CommentCreated, CommentDeleted, CommentedTextEntered, CommentedTextLeft, CommentChanged and CommentStateChanged events. When a comment is deleted, the CommentedText object provided with the event data has the following valid properties: HighlightColor, HighlightMode, Comment, CreationTime, ID and UserName. All other properties are undefined.

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

---

### Description

The CommentEventArgs class provides data for the [CommentCreated](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/commentcreated-event/llms-full.txt), [CommentDeleted](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/commentdeleted-event/llms-full.txt), [CommentedTextEntered](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/commentedtextentered-event/llms-full.txt), [CommentedTextLeft](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/commentedtextleft-event/llms-full.txt), [CommentChanged](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/commentchanged-event/llms-full.txt) and [CommentStateChanged](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/commentstatechanged-event/llms-full.txt) events. When a comment is deleted, the [CommentedText](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/commentedtext/llms-full.txt) object provided with the event data has the following valid properties: HighlightColor, HighlightMode, Comment, CreationTime, ID and UserName. All other properties are undefined.

### Syntax

```csharp
public class CommentEventArgs : EventArgs
```

```vbnet
Public Class CommentEventArgs
    Inherits EventArgs
```

### Examples

The following example uses `CommentEventArgs.CommentedText` while handling `CommentCreated`.

```csharp
textControl.CommentCreated += (_, e) =>
{
    e.CommentedText?.ScrollTo();
};
```

```vbnet
AddHandler textControl.CommentCreated,
    Sub(sender, e)
        If e.CommentedText IsNot Nothing Then e.CommentedText.ScrollTo()
    End Sub
```

---

## In This Section

- [CommentEventArgs.CommentedText Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/commenteventargs/commentedtext-property/llms-full.txt): Gets an object that represents the commented text. It is of the type CommentedText.

---

## Nearby

- **Previous:** [CommentedText.UserName Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/commentedtext/username-property/llms-full.txt)
- **Next:** [CommentEventArgs.CommentedText Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/commenteventargs/commentedtext-property/llms-full.txt)
