# TextFieldCollection.GetItem Method

> Gets a particular text field from the collection.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Method
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WPF.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 WPF > Reference > TXTextControl > TextFieldCollection.GetItem Method
- **860 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/textfieldcollection/getitem-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/textfieldcollection/getitem-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/textfieldcollection/getitem-method/llms-full.txt

---

### Description

Gets a particular text field from the collection.

### Syntax

#### GetItem()

Gets the text field at the current text input position or null, if there is no text field at the current text input position.

```csharp
public TextField GetItem();
```

```vbnet
Public Function GetItem() As TextField
```

#### GetItem(int)

Gets the text field with the specified id, previously set with the ID property.

```csharp
public TextField GetItem(int id);
```

```vbnet
Public Function GetItem(id As Integer) As TextField
```

| Parameter | Description |
|---|---|
| id | Specifies the text field's identifier set with the ID property. The method returns null if a text field with the specified identifier does not exist. |

### Examples

The following example works with text fields in the current document by using `TextFieldCollection.get_Item`.

```csharp
textControl.Text = "Customer: Contoso Ltd.";
textControl.Select(10, 12);
TextFieldCollection textFieldCollection = textControl.TextFields;
textFieldCollection.Add(new ApplicationField(ApplicationFieldFormat.MSWord, "MERGEFIELD", "Customer name", new[] { "CustomerName" }) { ID = 100 });

TextField result = textFieldCollection.GetItem(100);
result?.ScrollTo();
```

```vbnet
textControl.Text = "Customer: Contoso Ltd."
textControl.Select(10, 12)
Dim textFieldCollection As TextFieldCollection = textControl.TextFields
textFieldCollection.Add(New ApplicationField(ApplicationFieldFormat.MSWord, "MERGEFIELD", "Customer name", New String() { "CustomerName" }) With { .ID = 100 })

Dim result As TextField = textFieldCollection.GetItem(100)
If result IsNot Nothing Then result.ScrollTo()
```

---

## Nearby

- **Previous:** [TextFieldCollection.CopyTo Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/textfieldcollection/copyto-method/llms-full.txt)
- **Next:** [TextFieldCollection.Item Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/textfieldcollection/item-property/llms-full.txt)
