# DrawingCollection.GetItem Method

> Gets a particular drawing from the collection.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 23.0
- **Namespace:** `TXTextControl.DataVisualization`
- **Package:** `TXTextControl.TextControl.WinForms.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 Windows Forms > Reference > TXTextControl.DataVisualization > DrawingCollection.GetItem Method
- **753 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-datavisualization/drawingcollection/getitem-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-datavisualization/drawingcollection/getitem-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-datavisualization/drawingcollection/getitem-method/llms-full.txt

---

### Description

Gets a particular drawing from the collection.

### Syntax

#### GetItem()

Gets the drawing selected by the user.

```csharp
public DrawingFrame GetItem();
```

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

#### GetItem(int)

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

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

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

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

#### GetItem(string)

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

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

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

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

### Return Value

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

### Examples

The following example retrieves item from the drawing collection.

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

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

---

## Nearby

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