Add Method
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. WPF. SDK TXTextControl.from the private NuGet feed or Text Control Offline Packagesdll
Description
Inserts a new hypertext link at the current input position.
Syntax
public bool Add(HypertextLink hypertextLink);Public Function Add(hypertextLink As HypertextLink) As BooleanParameters
| Parameter | Description |
|---|---|
| hypertextLink | Specifies the hypertext link to add. |
Return Value
The return value is true, if the hypertext link could be added. Otherwise it is false.
Examples
The following example works with hypertext links in the current document by using HypertextLinkCollection.Add.
textControl.Text = "Customer: Contoso Ltd.";
textControl.Select(10, 12);
HypertextLinkCollection hypertextLinkCollection = textControl.HypertextLinks;
if (!hypertextLinkCollection.Add(new HypertextLink("Quarterly results", "Quarterly report")))
{
throw new InvalidOperationException("The item could not be inserted.");
}textControl.Text = "Customer: Contoso Ltd."
textControl.Select(10, 12)
Dim hypertextLinkCollection As HypertextLinkCollection = textControl.HypertextLinks
If Not hypertextLinkCollection.Add(New HypertextLink("Quarterly results", "Quarterly report")) Then
Throw New InvalidOperationException("The item could not be inserted.")
End If