# CommentedText Constructor

> Initializes a new instance of the CommentedText class.

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

---

### Description

Initializes a new instance of the CommentedText class.

### Syntax

#### CommentedText(string)

Creates a CommentedText object with the specified comment string. The current text selection defines the commented text.

```csharp
public CommentedText(string comment);
```

```vbnet
Public Sub New(comment As String)
```

| Parameter | Description |
|---|---|
| comment | Specifies a comment string. |

#### CommentedText(string, int, int)

Creates a CommentedText object with the specified comment string and start position and length specifying the commented text.

```csharp
public CommentedText(string comment, int start, int length);
```

```vbnet
Public Sub New(comment As String, start As Integer, length As Integer)
```

| Parameter | Description |
|---|---|
| comment | Specifies a comment string. |
| start | Specifies the index (one-based) of the commented text's first character. |
| length | Specifies the number of characters which belong to the commented text. |

#### CommentedText(string, CommentedText)

Creates a CommentedText object with the specified comment string which is a reply to the specified comment.

```csharp
public CommentedText(string comment, CommentedText repliedComment);
```

```vbnet
Public Sub New(comment As String, repliedComment As CommentedText)
```

| Parameter | Description |
|---|---|
| comment | Specifies a comment string. |
| repliedComment | The new comment is a reply to this comment. |

### Examples

The following example creates a Commented Text instance and configures its active setting for a document workflow.

```csharp
CommentedText commentedText = new("Quarterly report");
commentedText.Active = true;
```

```vbnet
Dim commentedText As New CommentedText("Quarterly report")
commentedText.Active = True
```

---

## Nearby

- **Previous:** [CommentedText.Comment Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/commentedtext/comment-property/llms-full.txt)
- **Next:** [CommentedText.CreationTime Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/commentedtext/creationtime-property/llms-full.txt)
