# IFormattedText.Find Method

> Finds a text string in the text part.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 16.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WinForms.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 Windows Forms > Reference > TXTextControl > IFormattedText.Find Method
- **753 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/iformattedtext/find-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/iformattedtext/find-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/iformattedtext/find-method/llms-full.txt

---

### Description

Finds a text string in the text part.

### Syntax

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

```vbnet
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-winforms/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 applies bold formatting through the iformatted text's selection by using `IFormattedText.Find`.

```csharp
Selection formattedSelection = iFormattedText.Selection;
formattedSelection.Bold = true;
iFormattedText.Selection = formattedSelection;

int position = iFormattedText.Find("Quarterly results", 1, FindOptions.Reverse);
if (position >= 0)
{
    Console.WriteLine($"Found at position {position}.");
}
```

```vbnet
Dim formattedSelection As Selection = iFormattedText.Selection
formattedSelection.Bold = True
iFormattedText.Selection = formattedSelection

Dim position As Integer = iFormattedText.Find("Quarterly results", 1, FindOptions.Reverse)
If position >= 0 Then
    Console.WriteLine($"Found at position {position}.")
End If
```

---

## Nearby

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