Clear Method
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. WPF. SDK TXTextControl.from the private NuGet feed or Text Control Offline Packagesdll
Description
Removes all hypertext 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 hypertext links are removed without deleting their texts. Otherwise, the texts are also deleted. |
Examples
The following example works with hypertext links in the current document by using HypertextLinkCollection.Clear.
textControl.Text = "Customer: Contoso Ltd.";
textControl.Select(10, 12);
HypertextLinkCollection hypertextLinkCollection = textControl.HypertextLinks;
hypertextLinkCollection.Add(new HypertextLink("Documentation", "https://docs.textcontrol.com/") { ID = 100 });
if (hypertextLinkCollection.Count > 0)
{
hypertextLinkCollection.Clear(true);
}textControl.Text = "Customer: Contoso Ltd."
textControl.Select(10, 12)
Dim hypertextLinkCollection As HypertextLinkCollection = textControl.HypertextLinks
hypertextLinkCollection.Add(New HypertextLink("Documentation", "https://docs.textcontrol.com/") With { .ID = 100 })
If hypertextLinkCollection.Count > 0 Then
hypertextLinkCollection.Clear(True)
End If