# DocumentTargetCollection.Item Property

> Gets the field with the specified number from the collection. The number must be between 1 and Count. In C# this property is the indexer for the DocumentTargetCollection class.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Property
- **Introduced:** 28.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WinForms.SDK` (assembly `TXTextControl.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.dll` from the setup
- **Path:** TX Text Control .NET for Windows Forms > Reference > TXTextControl > DocumentTargetCollection.Item Property
- **625 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/documenttargetcollection/item-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/documenttargetcollection/item-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/documenttargetcollection/item-property/llms-full.txt

---

### Description

Gets the field with the specified number from the collection. The number must be between 1 and Count. In C# this property is the indexer for the DocumentTargetCollection class.

### Syntax

```csharp
public DocumentTarget this[int number] { get; }
```

```vbnet
Default Public ReadOnly Property Item(number As Integer) As DocumentTarget
```

### Examples

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

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

Console.WriteLine($"Item: {documentTargetCollection[10]}");
Console.WriteLine("Document Target Collection is ready for use.");
```

```vbnet
textControl.Text = "Customer: Contoso Ltd."
textControl.Select(10, 12)
Dim documentTargetCollection As DocumentTargetCollection = textControl.DocumentTargets
documentTargetCollection.Add(New DocumentTarget("CustomerDetails") With { .ID = 100 })

Console.WriteLine($"Item: {documentTargetCollection.Item(10)}")
Console.WriteLine("Document Target Collection is ready for use.")
```

### Limitations

Read only.

---

## Nearby

- **Previous:** [DocumentTargetCollection.IsSynchronized Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/documenttargetcollection/issynchronized-property/llms-full.txt)
- **Next:** [DocumentTargetCollection.Remove Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/documenttargetcollection/remove-method/llms-full.txt)
