Remove Method
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. Core. SDK TXTextControl.from the private NuGet feed or Text Control Offline PackagesCore. dll
- Also in
TXTextControl.asTextControl. ASP. SDK TXTextControl.dll
Description
Removes an editable region from the collection. The region's text is not removed.
Syntax
public bool Remove(EditableRegion editableRegion, bool selectedPart);Public Function Remove(editableRegion As EditableRegion, selectedPart As Boolean) As BooleanParameters
| 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.
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.");
}
}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