# BarcodeCollection.GetItem Method

> Gets a particular barcode from the collection.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 19.0
- **Namespace:** `TXTextControl.DataVisualization`
- **Package:** `TXTextControl.TextControl.Core.SDK` (assembly `TXTextControl.Core.dll`, from the private NuGet feed or Text Control Offline Packages)
- **Package:** `TXTextControl.TextControl.ASP.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 Server > Reference > TXTextControl.DataVisualization > BarcodeCollection.GetItem Method
- **752 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-datavisualization/barcodecollection/getitem-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-datavisualization/barcodecollection/getitem-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-datavisualization/barcodecollection/getitem-method/llms-full.txt

---

### Description

Gets a particular barcode from the collection.

### Syntax

#### GetItem()

Gets the barcode selected by the user.

```csharp
public BarcodeFrame GetItem();
```

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

#### GetItem(int)

Gets the barcode with the specified identifier. An id can be set with the [ID](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/framebase/id-property/llms-full.txt) property.

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

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

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

#### GetItem(string)

Gets the barcode with the specified name. A name can be set with the [Name](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/framebase/name-property/llms-full.txt) property.

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

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

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

### Return Value

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

### Examples

The following example retrieves item from the barcode collection.

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

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

---

## Nearby

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