GetItem Method
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. WinForms. SDK TXTextControl.from the private NuGet feed or Text Control Offline Packagesdll
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();Public Function GetItem() As HypertextLinkGetItem(int)
Gets the hypertext link with the specified id. An id can be set with the HypertextLink.ID property.
public HypertextLink GetItem(int id);Public Function GetItem(id As Integer) As HypertextLink| Parameter | Description |
|---|---|
| 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();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 })
Dim result As HypertextLink = hypertextLinkCollection.GetItem(100)
If result IsNot Nothing Then result.ScrollTo()