# PageCollection Class

> An instance of the PageCollection class contains all pages of a document. A document has at least one page. An instance of this class can be obtained with the TextControl.GetPages method. The PageCollection class implements the IEnumerable and the ICollection interfaces.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Class
- **Introduced:** 14.0
- **Namespace:** `TXTextControl`
- **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
- **Implements:** `System.Collections.ICollection`, `System.Collections.IEnumerable`
- **Path:** TX Text Control .NET for Windows Forms > Reference > TXTextControl > PageCollection Class
- **643 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/pagecollection/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/pagecollection/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/pagecollection/llms-full.txt

---

### Description

An instance of the PageCollection class contains all pages of a document. A document has at least one page. An instance of this class can be obtained with the [TextControl.GetPages](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/getpages-property/llms-full.txt) method. The PageCollection class implements the IEnumerable and the ICollection interfaces.

### Syntax

```csharp
public sealed class PageCollection : ICollection, IEnumerable
```

```vbnet
Public NotInheritable Class PageCollection
    Implements ICollection, IEnumerable
```

### Examples

The following example works with the laid-out pages of a short report.

```csharp
textControl.Text = "Quarterly results\nRevenue increased by 12%.";
PageCollection pageCollection = textControl.GetPages();
```

```vbnet
textControl.Text = "Quarterly results" & vbCrLf & "Revenue increased by 12%."
Dim pageCollection As PageCollection = textControl.GetPages()
```

---

## In This Section

- [PageCollection.CopyTo Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/pagecollection/copyto-method/llms-full.txt): Copies the elements of the collection to an array, starting at a particular index.
- [PageCollection.Count Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/pagecollection/count-property/llms-full.txt): Gets the number of elements contained in the collection.
- [PageCollection.GetEnumerator Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/pagecollection/getenumerator-method/llms-full.txt): Returns an enumerator that can be used to iterate through the collection.
- [PageCollection.GetItem Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/pagecollection/getitem-method/llms-full.txt): Gets a particular page from the collection.
- [PageCollection.Item Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/pagecollection/item-property/llms-full.txt): Gets a page from the collection. In C# this property is the indexer for the PageCollection class.

---

## Nearby

- **Previous:** [PageBorder.TopLineWidth Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/pageborder/toplinewidth-property/llms-full.txt)
- **Next:** [PageCollection.CopyTo Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/pagecollection/copyto-method/llms-full.txt)
