# Find Method

> Searches the TXTextControl text for a string from a start index with SearchUp, MatchCase, NoHighLight, NoMessageBox and MatchWholeWord; returns the index or -1.

- **Product:** TX Text Control ActiveX
- **Section:** Documentation
- **Kind:** Method
- **Path:** TX Text Control ActiveX > API Reference > TXTextControl > Find Method
- **424 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/find-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/find-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/find-method/llms-full.txt

---

Searches the text in a Text Control for a given string.

### Syntax

```vbscript
TXTextControl.Find FindWhat[, Start[, Options]]
```

### Parameters

| Parameter | Description |
|---|---|
| FindWhat | Specifies the string to search for. |
| Start | Optional. An integer character index that determines where to begin the search. The first character of text in the control has an index of 0. When this parameter is omitted or set to -1, the search begins at the current input position. |
| Options | Optional. Is the sum of one or more constants used to specify optional features, as described in the following list: |

#### Options

| Constant | Description |
|---|---|
| 1 - SearchUp | Determines the direction of searches through a document. If this flag is used, the search direction is up; if the flag is not used, the search direction is down. |
| 4 - MatchCase | Determines if a match is based on the case of the specified string as well as the text of the string. |
| 8 - NoHighLight | Determines if a match appears highlighted in the Text Control. |
| 16 - NoMessageBox | Suppresses the built-in message boxes which inform the user that a match could not be found. |
| 64 - MatchWholeWord | Searches for whole words only. |

### Return Value

If the text searched for is found, the Find method highlights the specified text and returns the index (zero-based) of the first character highlighted. If the specified text is not found, the Find method returns -1.

### Data Types

| Name | Data type |
|---|---|
| FindWhat | String |
| Start | Long |
| Options | Long |
| Return value | Long |

### See Also

- [FindReplace Method](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/findreplace-method/llms-full.txt)
- [Programming Category: Search and Replace](https://docs.textcontrol.com/tx-text-control-activex/reference/categories/search-replace/llms-full.txt)

---

## Nearby

- **Previous:** [FieldTypeData Property](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/fieldtypedata-property/llms-full.txt)
- **Next:** [FindReplace Method](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/findreplace-method/llms-full.txt)
