# EditableRegionCollection.Remove Method

> Removes an editable region from the collection. The region's text is not removed.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Method
- **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 > EditableRegionCollection.Remove Method
- **873 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/editableregioncollection/remove-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/editableregioncollection/remove-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/editableregioncollection/remove-method/llms-full.txt

---

### Description

Removes an editable region from the collection. The region's text is not removed.

### Syntax

```csharp
public bool Remove(EditableRegion editableRegion, bool selectedPart);
```

```vbnet
Public Function Remove(editableRegion As EditableRegion, selectedPart As Boolean) As Boolean
```

### Parameters

| Parameter | Description |
|---|---|
| editableRegion | Specifies the editable region to remove. |
| selectedPart | When this parameter is true, only the selected part of the editable region is removed. If the selection is in the middle od the region, it is split into two parts with the same parameters. |

### Return Value

The return value is true, if the region could be removed. Otherwise, it is false.

### Examples

The following example works with editable regions in the current document by using `EditableRegionCollection.Remove`.

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

if (editableRegionCollection.Count > 0)
{
    EditableRegion editableRegion = editableRegionCollection[1];
    if (editableRegionCollection.Remove(editableRegion, true))
    {
        Console.WriteLine("The item was removed.");
    }
}
```

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

If editableRegionCollection.Count > 0 Then
    Dim editableRegion As EditableRegion = editableRegionCollection.Item(1)
    If editableRegionCollection.Remove(editableRegion, True) Then
        Console.WriteLine("The item was removed.")
    End If
End If
```

---

## Nearby

- **Previous:** [EditableRegionCollection.Item Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/editableregioncollection/item-property/llms-full.txt)
- **Next:** [EditableRegionCollection.SyncRoot Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/editableregioncollection/syncroot-property/llms-full.txt)
