# EditableRegion Constructor

> Initializes a new instance of the EditableRegion class.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Constructor
- **Introduced:** 25.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
- **Path:** TX Text Control .NET Server > Reference > TXTextControl > EditableRegion Constructor
- **1007 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/editableregion/constructor/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/editableregion/constructor/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/editableregion/constructor/llms-full.txt

---

### Description

Initializes a new instance of the EditableRegion class.

### Syntax

#### EditableRegion(string, int)

Creates an editable region with the specified user name and/or id. The start and length of the editable region are initialized to zero. When a zero-length editable region is inserted, the current text selection defines it position and length.

```csharp
public EditableRegion(string userName, int id);
```

```vbnet
Public Sub New(userName As String, id As Integer)
```

| Parameter | Description |
|---|---|
| userName | Specifies the name of the user who can edit the region. This parameter can be null or an empty string to indicate, that no user name has been specified and the region can be edited by everyone. |
| id | Specifies an identifier for the editable region. This parameter can be 0 to indicate, that the editable region has no identifier. |

#### EditableRegion(string, int, int, int)

Creates an editable region with the specified user name, id, start position and length.

```csharp
public EditableRegion(string userName, int id, int start, int length);
```

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

| Parameter | Description |
|---|---|
| userName | Specifies the name of the user who can edit the region. This parameter can be null or an empty string to indicate, that no user name has been specified and the region can be edited by everyone. |
| id | Specifies an identifier for the editable region. This parameter can be 0 to indicate, that the editable region has no identifier. |
| start | Specifies the index (one-based) of the first character which belongs to the editable region. |
| length | Specifies the number of characters which belong to the editable region. |

### Examples

The following example marks selected contract text as editable by the review team.

```csharp
textControl.Text = "Terms subject to legal review";
textControl.Select(0, textControl.Text.Length);
EditableRegion editableRegion = new("ReviewTeam", 10);
textControl.EditableRegions.Add(editableRegion);
```

```vbnet
textControl.Text = "Terms subject to legal review"
textControl.Select(0, textControl.Text.Length)
Dim editableRegion As New EditableRegion("ReviewTeam", 10)
textControl.EditableRegions.Add(editableRegion)
```

---

## Nearby

- **Previous:** [EditableRegion Class](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/editableregion/llms-full.txt)
- **Next:** [EditableRegion.DefaultHighlightColor Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/editableregion/defaulthighlightcolor-property/llms-full.txt)
