Clear 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 all document links from a Text Control document.
Syntax
public void Clear(bool keepText);Public Sub Clear(keepText As Boolean)Parameters
| Parameter | Description |
|---|---|
| keepText | If this parameter is set to true, all document links are removed without deleting their texts. Otherwise, the texts are also deleted. |
Examples
The following example works with document links in the current document by using DocumentLinkCollection.Clear.
textControl.Text = "Customer: Contoso Ltd.";
textControl.Select(10, 12);
DocumentLinkCollection documentLinkCollection = textControl.DocumentLinks;
DocumentTarget target = new("CustomerDetails");
textControl.DocumentTargets.Add(target);
documentLinkCollection.Add(new DocumentLink("View customer details", target) { ID = 100 });
if (documentLinkCollection.Count > 0)
{
documentLinkCollection.Clear(true);
}textControl.Text = "Customer: Contoso Ltd."
textControl.Select(10, 12)
Dim documentLinkCollection As DocumentLinkCollection = textControl.DocumentLinks
Dim target As New DocumentTarget("CustomerDetails")
textControl.DocumentTargets.Add(target)
documentLinkCollection.Add(New DocumentLink("View customer details", target) With { .ID = 100 })
If documentLinkCollection.Count > 0 Then
documentLinkCollection.Clear(True)
End If