# TextFrameCollection.GetItem Method

> Gets a particular text frame from the collection.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 15.1
- **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 > TextFrameCollection.GetItem Method
- **974 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/textframecollection/getitem-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/textframecollection/getitem-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/textframecollection/getitem-method/llms-full.txt

---

### Description

Gets a particular text frame from the collection.

### Syntax

#### GetItem()

Gets the text frame selected by the user or null if no text frame is selected.

```csharp
public TextFrame GetItem();
```

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

#### GetItem(int)

Gets the text frame with the specified identifier.

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

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

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

#### GetItem(string)

Gets the text frame with the specified name.

```csharp
public TextFrame GetItem(string name);
```

```vbnet
Public Function GetItem(name As String) As TextFrame
```

| Parameter | Description |
|---|---|
| name | Specifies the text frame's name set with the Name property. The method returns null if a text frame with the specified name does not exist. |

### Return Value

The return value is null, if a text frame with the specified parameters could not be found. Otherwise, it is an object of the type [TextFrame](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/textframe/llms-full.txt).

### Examples

The following example works with text frames in the current document by using `TextFrameCollection.GetItem`.

```csharp
TextFrameCollection textFrameCollection = textControl.TextFrames;
textFrameCollection.Add(new TextFrame(new System.Drawing.Size(3000, 1200)) { Name = "Callout", ID = 100 }, TextFrameInsertionMode.DisplaceText);

var result = textFrameCollection.GetItem(100);
Console.WriteLine($"Get Item result: {result}");
```

```vbnet
Dim textFrameCollection As TextFrameCollection = textControl.TextFrames
textFrameCollection.Add(New TextFrame(New System.Drawing.Size(3000, 1200)) With { .Name = "Callout", .ID = 100 }, TextFrameInsertionMode.DisplaceText)

Dim result = textFrameCollection.GetItem(100)
Console.WriteLine($"Get Item result: {result}")
```

---

## Nearby

- **Previous:** [TextFrameCollection.GetActivatedItem Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/textframecollection/getactivateditem-method/llms-full.txt)
- **Next:** [TextFrameCollection.Remove Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/textframecollection/remove-method/llms-full.txt)
