# BarcodeCollection.CopyTo Method

> Copies the elements of the collection to an array, starting at a particular index.

- **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.CopyTo Method
- **496 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-datavisualization/barcodecollection/copyto-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-datavisualization/barcodecollection/copyto-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-datavisualization/barcodecollection/copyto-method/llms-full.txt

---

### Description

Copies the elements of the collection to an array, starting at a particular index.

### Syntax

```csharp
public override void CopyTo(Array array, int index);
```

```vbnet
Public Overrides Sub CopyTo(array As Array, index As Integer)
```

### Parameters

| Parameter | Description |
|---|---|
| array | Specifies the array to which to copy. |
| index | Specifies the index of the destination array at which to begin copying. |

### Examples

The following example copies the barcode collection into a strongly typed array.

```csharp
TXTextControl.DataVisualization.BarcodeFrame[] items = new TXTextControl.DataVisualization.BarcodeFrame[barcodeCollection.Count];
barcodeCollection.CopyTo(items, 0);
```

```vbnet
If barcodeCollection.Count > 0 Then
    Dim items(barcodeCollection.Count - 1) As TXTextControl.DataVisualization.BarcodeFrame
    barcodeCollection.CopyTo(items, 0)
End If
```

---

## Nearby

- **Previous:** [BarcodeCollection.Add Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-datavisualization/barcodecollection/add-method/llms-full.txt)
- **Next:** [BarcodeCollection.GetItem Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-datavisualization/barcodecollection/getitem-method/llms-full.txt)
