# ShapeCollection Class

> An instance of the ShapeCollection class contains all displayed shapes represented through objects of type Shape. It is inherited from the abstract class System.Collections.CollectionBase and implements the System.Collections.IEnumerable and System.Collections.IEnumerator interfaces. For a list of properties, methods and events of these classes and interfaces see the .NET Framework reference.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Class
- **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
- **Inherits:** `System.Collections.CollectionBase`
- **Implements:** `System.Collections.IEnumerable`, `System.Collections.IEnumerator`
- **Path:** TX Text Control .NET Server > Reference > TXTextControl.Drawing > ShapeCollection Class
- **764 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-drawing/shapecollection/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-drawing/shapecollection/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-drawing/shapecollection/llms-full.txt

---

### Description

An instance of the ShapeCollection class contains all displayed shapes represented through objects of type [Shape](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-drawing/shape/llms-full.txt). It is inherited from the abstract class `System.Collections.CollectionBase` and implements the `System.Collections.IEnumerable` and `System.Collections.IEnumerator` interfaces. For a list of properties, methods and events of these classes and interfaces see the .NET Framework reference.

### Syntax

```csharp
public class ShapeCollection : CollectionBase, IEnumerable, IEnumerator
```

```vbnet
Public Class ShapeCollection
    Inherits CollectionBase
    Implements IEnumerable, IEnumerator
```

### Examples

The following example includes the current value from a Shape Collection object in application diagnostics. The created object is then available to the surrounding document workflow.

```csharp
Console.WriteLine($"Current: {shapeCollection.Current}");
Console.WriteLine("Shape Collection is ready for use.");
```

```vbnet
Console.WriteLine($"Current: {shapeCollection.Current}")
Console.WriteLine("Shape Collection is ready for use.")
```

---

## In This Section

- [ShapeCollection.Add Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-drawing/shapecollection/add-method/llms-full.txt): Adds an object of the type Shape to the collection.
- [ShapeCollection.Insert Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-drawing/shapecollection/insert-method/llms-full.txt): Inserts an object of the type Shape to the collection at a specified index.
- [ShapeCollection.Item Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-drawing/shapecollection/item-property/llms-full.txt): Gets an object of type Shape from the collection. This property is the indexer for the ShapeCollection class.
- [ShapeCollection.Remove Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-drawing/shapecollection/remove-method/llms-full.txt): Removes an object of the type Shape from the collection.

---

## Nearby

- **Previous:** [Shape.Type Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-drawing/shape/type-property/llms-full.txt)
- **Next:** [ShapeCollection.Add Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-drawing/shapecollection/add-method/llms-full.txt)
