# EditableRegionCollection Class

> Contains all editable regions in the main text or another part of a document. It is a collection of objects of the type EditableRegion. A collection object can be obtained with the TextControl.EditableRegions, the HeaderFooter.EditableRegions or the TextFrame.EditableRegions property. The EditableRegionCollection class implements the IEnumerable and the ICollection interfaces. 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.

- **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
- **Implements:** `System.Collections.ICollection`, `System.Collections.IEnumerable`
- **Path:** TX Text Control .NET for WPF > Reference > TXTextControl > EditableRegionCollection Class
- **1347 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/editableregioncollection/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/editableregioncollection/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/editableregioncollection/llms-full.txt

---

### Description

Contains all editable regions in the main text or another part of a document. It is a collection of objects of the type [EditableRegion](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/editableregion/llms-full.txt). A collection object can be obtained with the [TextControl.EditableRegions](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/editableregions-property/llms-full.txt), the [HeaderFooter.EditableRegions](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/headerfooter/editableregions-property/llms-full.txt) or the [TextFrame.EditableRegions](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/textframe/editableregions-property/llms-full.txt) property. The EditableRegionCollection class implements the IEnumerable and the ICollection interfaces. 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.

### Syntax

```csharp
public sealed class EditableRegionCollection : ICollection, IEnumerable
```

```vbnet
Public NotInheritable Class EditableRegionCollection
    Implements ICollection, IEnumerable
```

### Examples

The following example works with editable regions in the current document.

```csharp
textControl.Text = "Customer: Contoso Ltd.";
textControl.Select(10, 12);
EditableRegionCollection editableRegionCollection = textControl.EditableRegions;
editableRegionCollection.Add(new EditableRegion("ReviewTeam", 100));
```

```vbnet
textControl.Text = "Customer: Contoso Ltd."
textControl.Select(10, 12)
Dim editableRegionCollection As EditableRegionCollection = textControl.EditableRegions
editableRegionCollection.Add(New EditableRegion("ReviewTeam", 100))
```

---

## In This Section

- [EditableRegionCollection.Add Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/editableregioncollection/add-method/llms-full.txt): Adds a new editable region to the document. Its position is defined through the EditableRegion.Start and EditableRegion.Length properties. If the editable region's length is zero, the current text selection is used to define the position.
- [EditableRegionCollection.AddResult Enumeration](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/editableregioncollection/addresult-enumeration/llms-full.txt): Specifies the result when an editable region has been added to the document.
- [EditableRegionCollection.CopyTo Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/editableregioncollection/copyto-method/llms-full.txt): Copies the elements of the collection to an array, starting at a particular index.
- [EditableRegionCollection.Count Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/editableregioncollection/count-property/llms-full.txt): Gets the number of elements contained in the collection.
- [EditableRegionCollection.GetEnumerator Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/editableregioncollection/getenumerator-method/llms-full.txt): Returns an enumerator that can be used to iterate through the collection.
- [EditableRegionCollection.GetItem Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/editableregioncollection/getitem-method/llms-full.txt): Gets the editable region with the specified id. The method returns null, if such a region does not exist. If more than one region with this id exists, the first found region is returned.
- [EditableRegionCollection.GetItems Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/editableregioncollection/getitems-method/llms-full.txt): Gets all editable regions at the current text input position. The method returns null, if there is no region at the current input position.
- [EditableRegionCollection.IsSynchronized Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/editableregioncollection/issynchronized-property/llms-full.txt): Returns true if the collection is designed to be thread safe, otherwise, it returns false.
- [EditableRegionCollection.Item Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/editableregioncollection/item-property/llms-full.txt): Gets the editable region with the specified number from the collection. The number must be between 1 and Count. In C# this property is the indexer for the EditableRegionCollection class.
- [EditableRegionCollection.Remove Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/editableregioncollection/remove-method/llms-full.txt): Removes an editable region from the collection. The region's text is not removed.
- [EditableRegionCollection.SyncRoot Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/editableregioncollection/syncroot-property/llms-full.txt): Gets an object that can be used to synchronize access to the collection.

---

## Nearby

- **Previous:** [EditableRegion.UserName Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/editableregion/username-property/llms-full.txt)
- **Next:** [EditableRegionCollection.Add Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/editableregioncollection/add-method/llms-full.txt)
