# HeaderFooter.Find Method

> Finds a text string in a header or footer.

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

---

### Description

Finds a text string in a header or footer.

### Syntax

```csharp
public int Find(string text, int start, FindOptions options);
```

```vbnet
Public Function Find(text As String, start As Integer, options As FindOptions) As Integer
```

### Parameters

| Parameter | Description |
|---|---|
| text | Specifies the text to search for. |
| start | Specifies the text position where the search starts, beginning with 0. If this value is -1, the search begins at the current text input position. |
| options | Specifies search options. It can be a combination of the [FindOptions](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/findoptions/enumeration/llms-full.txt) values. |

### Return Value

If the text searched for is found, the method returns the index (zero-based) of the first character of the search string. If the specified text is not found the method returns -1.

### Examples

The following example finds a department name in the header and emphasizes it.

```csharp
HeaderFooterCollection headers = textControl.Sections[1].HeadersAndFooters;
headers.Add(HeaderFooterType.Header);
HeaderFooter headerFooter = headers.GetItem(HeaderFooterType.Header);
headerFooter.Selection.Text = "Finance — Quarterly report";
int position = headerFooter.Find("Finance", 1, FindOptions.Reverse);
if (position >= 0)
{
    headerFooter.Selection.Start = position;
    headerFooter.Selection.Length = "Finance".Length;
    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 = "Finance — Quarterly report"
Dim position As Integer = headerFooter.Find("Finance", 1, FindOptions.Reverse)
If position >= 0 Then
    headerFooter.Selection.Start = position
    headerFooter.Selection.Length = "Finance".Length
    headerFooter.Selection.Bold = True
End If
```

---

## Nearby

- **Previous:** [HeaderFooter.EditableRegions Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/headerfooter/editableregions-property/llms-full.txt)
- **Next:** [HeaderFooter.FormFields Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/headerfooter/formfields-property/llms-full.txt)
