# TextControl.HeadersAndFooters Property

> Gets a collection of all headers and footers the current document contains. The property's value is an object of the type HeaderFooterCollection.

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

---

### Description

Gets a collection of all headers and footers the current document contains. The property's value is an object of the type [HeaderFooterCollection](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/headerfootercollection/llms-full.txt).

### Syntax

```csharp
public HeaderFooterCollection HeadersAndFooters { get; }
```

```vbnet
Public ReadOnly Property HeadersAndFooters As HeaderFooterCollection
```

### Examples

The following example iterates through the headers and footers collection and processes each header footer.

```csharp
foreach (HeaderFooter headerFooter in textControl.HeadersAndFooters)
{
    Console.WriteLine(headerFooter.ConnectedToPrevious);
}
```

```vbnet
For Each headerFooter As HeaderFooter In textControl.HeadersAndFooters
    Console.WriteLine(headerFooter.ConnectedToPrevious)
Next
```

### Limitations

Runtime only.

Read only.

---

## Nearby

- **Previous:** [TextControl.HeaderFooterFrameStyle Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/headerfooterframestyle-property/llms-full.txt)
- **Next:** [TextControl.HExpanded Event](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/hexpanded-event/llms-full.txt)
