# TextControl.Pages Property

> Gets the number of pages contained in the current document.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Property
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WinForms.SDK` (assembly `TXTextControl.Windows.Forms.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.Windows.Forms.dll` from the setup
- **Path:** TX Text Control .NET for Windows Forms > Reference > TXTextControl > TextControl.Pages Property
- **331 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/pages-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/pages-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/pages-property/llms-full.txt

---

### Description

Gets the number of pages contained in the current document.

### Syntax

```csharp
public int Pages { get; }
```

```vbnet
Public ReadOnly Property Pages As Integer
```

### Examples

The following example checks the current page count before adding a forced page break.

```csharp
if (textControl.Pages == 1)
{
    textControl.Selection.Text = "\fAppendix";
}
```

```vbnet
If textControl.Pages = 1 Then
    textControl.Selection.Text = ChrW(12) & "Appendix"
End If
```

### Limitations

Runtime only.

Read only.

---

## Nearby

- **Previous:** [TextControl.PageMargins Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/pagemargins-property/llms-full.txt)
- **Next:** [TextControl.PageSize Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/pagesize-property/llms-full.txt)
