TX Text Control ActiveX

Find Method

Method

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

Syntax

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

Parameters

ParameterDescription
FindWhatSpecifies the string to search for.
StartOptional. 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.
OptionsOptional. Is the sum of one or more constants used to specify optional features, as described in the following list:

Options

ConstantDescription
1 - SearchUpDetermines 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 - MatchCaseDetermines if a match is based on the case of the specified string as well as the text of the string.
8 - NoHighLightDetermines if a match appears highlighted in the Text Control.
16 - NoMessageBoxSuppresses the built-in message boxes which inform the user that a match could not be found.
64 - MatchWholeWordSearches 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

NameData type
FindWhatString
StartLong
OptionsLong
Return valueLong

See Also