GetItem Method
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. WPF. SDK TXTextControl.from the private NuGet feed or Text Control Offline Packagesdll
Description
Gets a particular document link from the collection.
Syntax
GetItem()
Gets the document link at the current input position or null if there is no document link at the current input position.
public DocumentLink GetItem();Public Function GetItem() As DocumentLinkGetItem(int)
Gets the document link with the specified id, previously set with the DocumentLink.ID property.
public DocumentLink GetItem(int id);Public Function GetItem(id As Integer) As DocumentLink| Parameter | Description |
|---|---|
| id | Specifies the document link's identifier. The method returns null if a document link with the specified identifier does not exist. |
Examples
The following example works with document links in the current document by using DocumentLinkCollection.get_Item.
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 });
DocumentLink result = documentLinkCollection.GetItem(100);
result?.ScrollTo();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 })
Dim result As DocumentLink = documentLinkCollection.GetItem(100)
If result IsNot Nothing Then result.ScrollTo()