TX Text Control .NET for Windows Forms

GetItems Method

Method|Introduced in 28.0
Namespace
TXTextControl
Package
TXTextControl.TextControl.WinForms.SDK as TXTextControl.dll from the private NuGet feed or Text Control Offline Packages

Description

Gets all document targets at the current text input position. The method returns null, if there is no target at the current input position.

Syntax

public DocumentTarget[] GetItems();

Return Value

The return value is null, if there is no target at the current input position. Otherwise, it is an array of objects of the type DocumentTarget.

Examples

The following example works with document targets in the current document by using DocumentTargetCollection.GetItems.

textControl.Text = "Customer: Contoso Ltd.";
textControl.Select(10, 12);
DocumentTargetCollection documentTargetCollection = textControl.DocumentTargets;
documentTargetCollection.Add(new DocumentTarget("CustomerDetails") { ID = 100 });

DocumentTarget[] results = documentTargetCollection.GetItems();
foreach (DocumentTarget documentTarget in results)
{
    Console.WriteLine(documentTarget);
}