# EditableRegion Class

> An EditableRegion object represents an editable region in a TX Text Control document. When the EditMode property of a Text Control has been set to ReadAndSelect, editable regions can still be edited, either by everyone or depending on the UserName property by a certain user. Each of the main textparts of a document has an EditableRegionCollection which can be used to add and remove editable regions or to save the editable region's text.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Class
- **Introduced:** 25.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WPF.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 WPF > Reference > TXTextControl > EditableRegion Class
- **1279 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/editableregion/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/editableregion/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/editableregion/llms-full.txt

---

### Description

An EditableRegion object represents an editable region in a TX Text Control document. When the [EditMode](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/editmode-property/llms-full.txt) property of a Text Control has been set to `ReadAndSelect`, editable regions can still be edited, either by everyone or depending on the [UserName](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/editableregion/username-property/llms-full.txt) property by a certain user. Each of the main textparts of a document has an [EditableRegionCollection](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/editableregioncollection/llms-full.txt) which can be used to add and remove editable regions or to save the editable region's text.

### Syntax

```csharp
public class EditableRegion
```

```vbnet
Public Class EditableRegion
```

### 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)
```

---

## In This Section

- [EditableRegion Constructor](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/editableregion/constructor/llms-full.txt): Initializes a new instance of the EditableRegion class.
- [EditableRegion.DefaultHighlightColor Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/editableregion/defaulthighlightcolor-property/llms-full.txt): Gets the default highlight color of an editable region. If the highlight color of an editable region is this default color and a user name is specified, the highlight color is set to a color depending on the user name.
- [EditableRegion.HighlightColor Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/editableregion/highlightcolor-property/llms-full.txt): Gets or sets the highlight color for the editable region. The color's alpha value must be less than 255 (opaque) so that the editable region's text remains visible. The default value is green with an alpha value of 60. If the highlight color is EditableRegion.DefaultHighlightColor and a user name is specified, the highlight color is set to a color depending on the user name.
- [EditableRegion.HighlightMode Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/editableregion/highlightmode-property/llms-full.txt): Gets or sets a value indicating when the editable region is highlighted.
- [EditableRegion.ID Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/editableregion/id-property/llms-full.txt): Gets or sets the editable region's identifier. It must be a one-based value. A value of zero indicates that the editable region has no identifier.
- [EditableRegion.Length Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/editableregion/length-property/llms-full.txt): Gets the number of characters which belong to the editable region.
- [EditableRegion.Number Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/editableregion/number-property/llms-full.txt): Gets the editable region's number. The first editable region has the number 1. The number is defined through the textflow. An editable region with a smaller start position has a smaller number.
- [EditableRegion.Save Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/editableregion/save-method/llms-full.txt): Saves the editable region's text with the specified format.
- [EditableRegion.ScrollTo Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/editableregion/scrollto-method/llms-full.txt): Sets the current input position to the beginning of an editable region and scrolls it into the visible part of the document.
- [EditableRegion.Start Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/editableregion/start-property/llms-full.txt): Gets the index (one-based) of the first character which belongs to the editable region.
- [EditableRegion.Text Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/editableregion/text-property/llms-full.txt): Gets the editable region's text.
- [EditableRegion.UserName Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/editableregion/username-property/llms-full.txt): Gets or sets 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.

---

## Nearby

- **Previous:** [DocumentTargetEventArgs.DocumentTarget Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/documenttargeteventargs/documenttarget-property/llms-full.txt)
- **Next:** [EditableRegion Constructor](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/editableregion/constructor/llms-full.txt)
