# HeaderFooter.Selection Property

> Gets or sets the current selection in a header or footer. The property value is an object of the type Selection. For more information see the description of the Selection class.

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

---

### Description

Gets or sets the current selection in a header or footer. The property value is an object of the type [Selection](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/selection/llms-full.txt). For more information see the description of the Selection class.

### Syntax

```csharp
public Selection Selection { get; set; }
```

```vbnet
Public Property Selection As Selection
```

### Examples

The following example uses the header's selection to insert and format a report title.

```csharp
HeaderFooterCollection headers = textControl.Sections[1].HeadersAndFooters;
headers.Add(HeaderFooterType.Header);
HeaderFooter headerFooter = headers.GetItem(HeaderFooterType.Header);
headerFooter.Selection.Text = "Quarterly report";
headerFooter.Selection.Bold = true;
```

```vbnet
Dim headers As HeaderFooterCollection = textControl.Sections(1).HeadersAndFooters
headers.Add(HeaderFooterType.Header)
Dim headerFooter As HeaderFooter = headers.GetItem(HeaderFooterType.Header)
headerFooter.Selection.Text = "Quarterly report"
headerFooter.Selection.Bold = True
```

---

## Nearby

- **Previous:** [HeaderFooter.SectionNumber Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/headerfooter/sectionnumber-property/llms-full.txt)
- **Next:** [HeaderFooter.SubTextParts Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/headerfooter/subtextparts-property/llms-full.txt)
