TX Text Control .NET for WPF

GetItem Method

Method
Namespace
TXTextControl
Package
TXTextControl.TextControl.WPF.SDK as TXTextControl.dll from the private NuGet feed or Text Control Offline Packages

Description

Gets a particular hypertext link from the collection.

Syntax

GetItem()

Gets the hypertext link at the current input position or null if there is no hypertext link at the current input position.

public HypertextLink GetItem();

GetItem(int)

Gets the hypertext link with the specified id. An id can be set with the HypertextLink.ID property.

public HypertextLink GetItem(int id);
ParameterDescription
id

Specifies the hypertext link's identifier. The method returns null if a hypertext link with the specified identifier does not exist.

Examples

The following example works with hypertext links in the current document by using HypertextLinkCollection.get_Item.

textControl.Text = "Customer: Contoso Ltd.";
textControl.Select(10, 12);
HypertextLinkCollection hypertextLinkCollection = textControl.HypertextLinks;
hypertextLinkCollection.Add(new HypertextLink("Documentation", "https://docs.textcontrol.com/") { ID = 100 });

HypertextLink result = hypertextLinkCollection.GetItem(100);
result?.ScrollTo();