# ShapeCollection.Remove Method

> Removes an object of the type Shape from the collection.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 23.0
- **Namespace:** `TXTextControl.Drawing`
- **Package:** `TXTextControl.TextControl.Core.SDK` (assembly `TXDrawing.dll`, from the private NuGet feed or Text Control Offline Packages)
- **Package:** `TXTextControl.TextControl.ASP.SDK` (assembly `TXDrawing.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXDrawing.dll` from the setup
- **Path:** TX Text Control .NET Server > Reference > TXTextControl.Drawing > ShapeCollection.Remove Method
- **433 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-drawing/shapecollection/remove-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-drawing/shapecollection/remove-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-drawing/shapecollection/remove-method/llms-full.txt

---

### Description

Removes an object of the type [Shape](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-drawing/shape/llms-full.txt) from the [collection](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-drawing/shapecollection/llms-full.txt).

### Syntax

```csharp
public void Remove(Shape shape);
```

```vbnet
Public Sub Remove(shape As Shape)
```

### Parameters

| Parameter | Description |
|---|---|
| shape | Specifies the [shape](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-drawing/shape/llms-full.txt) to remove. |

### Examples

The following example removes the first shape when the collection is not empty.

```csharp
if (shapeCollection.Count > 0)
{
    TXTextControl.Drawing.Shape shape = shapeCollection[1];
    shapeCollection.Remove(shape);
}
```

```vbnet
If shapeCollection.Count > 0 Then
    Dim shape As TXTextControl.Drawing.Shape = shapeCollection.Item(1)
    shapeCollection.Remove(shape)
End If
```

---

## Nearby

- **Previous:** [ShapeCollection.Item Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-drawing/shapecollection/item-property/llms-full.txt)
- **Next:** [ShapeEventArgs Class](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-drawing/shapeeventargs/llms-full.txt)
