# FrameCollection.GetItem Method

> Gets a particular image, text frame, chart, barcode or drawing from the collection.

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

---

### Description

Gets a particular image, text frame, chart, barcode or drawing from the collection.

### Syntax

#### GetItem()

Gets the image, text frame, chart, barcode or drawing selected by the user.

```csharp
public FrameBase GetItem();
```

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

#### GetItem(int)

Gets the image, text frame, chart, barcode or drawing with the specified identifier. An identifier can be set with the [FrameBase.ID](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/framebase/id-property/llms-full.txt) property.

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

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

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

#### GetItem(string)

Gets the image, text frame, chart, barcode or drawing with the specified name. A name can be set with the [FrameBase.Name](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/framebase/name-property/llms-full.txt) property.

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

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

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

### Return Value

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

### Examples

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

```csharp
FrameCollection frameCollection = textControl.Frames;
TextFrame callout = new(new System.Drawing.Size(3000, 1200)) { Name = "Callout" };
textControl.TextFrames.Add(callout, TextFrameInsertionMode.DisplaceText);

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

```vbnet
Dim frameCollection As FrameCollection = textControl.Frames
Dim callout As New TextFrame(New System.Drawing.Size(3000, 1200)) With { .Name = "Callout" }
textControl.TextFrames.Add(callout, TextFrameInsertionMode.DisplaceText)

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

---

## Nearby

- **Previous:** [FrameCollection.CopyTo Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/framecollection/copyto-method/llms-full.txt)
- **Next:** [FrameCollection.Remove Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/framecollection/remove-method/llms-full.txt)
