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 the specified target from a Text Control document.
Syntax
public bool Remove(DocumentTarget documentTarget);Public Function Remove(documentTarget As DocumentTarget) As BooleanParameters
| Parameter | Description |
|---|---|
| documentTarget | Specifies the document target to remove. |
Return Value
The return value is true, if the document target could be removed. Otherwise it is false.
Examples
The following example works with document targets in the current document by using DocumentTargetCollection.Remove.
textControl.Text = "Customer: Contoso Ltd.";
textControl.Select(10, 12);
DocumentTargetCollection documentTargetCollection = textControl.DocumentTargets;
documentTargetCollection.Add(new DocumentTarget("CustomerDetails") { ID = 100 });
if (documentTargetCollection.Count > 0)
{
DocumentTarget documentTarget = documentTargetCollection[1];
if (documentTargetCollection.Remove(documentTarget))
{
Console.WriteLine("The item was removed.");
}
}textControl.Text = "Customer: Contoso Ltd."
textControl.Select(10, 12)
Dim documentTargetCollection As DocumentTargetCollection = textControl.DocumentTargets
documentTargetCollection.Add(New DocumentTarget("CustomerDetails") With { .ID = 100 })
If documentTargetCollection.Count > 0 Then
Dim documentTarget As DocumentTarget = documentTargetCollection.Item(1)
If documentTargetCollection.Remove(documentTarget) Then
Console.WriteLine("The item was removed.")
End If
End If