# HeaderFooter.Activate Method

> Activates a header or a footer.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Method
- **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.Activate Method
- **561 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/headerfooter/activate-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/headerfooter/activate-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/headerfooter/activate-method/llms-full.txt

---

### Description

Activates a header or a footer.

### Syntax

```csharp
public bool Activate();
```

```vbnet
Public Function Activate() As Boolean
```

### Return Value

The return value is true, if the header or footer could be activated. Otherwise it is false.

### Examples

The following example creates a header for the first section and configures its content or layout by using `HeaderFooter.Activate`.

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

if (headerFooter.Activate())
{
    Console.WriteLine("Activate completed successfully.");
}
```

```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"

If headerFooter.Activate() Then
    Console.WriteLine("Activate completed successfully.")
End If
```

---

## Nearby

- **Previous:** [HeaderFooter Class](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/headerfooter/llms-full.txt)
- **Next:** [HeaderFooter.AddUndoUnit Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/headerfooter/addundounit-method/llms-full.txt)
