Version

FindText Method

Reports the zero-based index of the first occurrence of the specified string in the editor's current text. The search starts from the current selection.
Syntax
'Declaration
 
Public Function FindText( _
   ByVal value As String, _
   ByVal searchDirection As FindTextDirection, _
   ByVal caseSensitive As Boolean, _
   Optional ByVal selectText As Boolean _
) As Integer
public int FindText( 
   string value,
   FindTextDirection searchDirection,
   bool caseSensitive,
   bool selectText
)

Parameters

value
The string to seek.
searchDirection
The direction to search in, relative to the current selection.
caseSensitive
Specify true for a case-sensitive search; otherwise false.
selectText
Specify true to automatically select the text if the editor is in edit mode.

Return Value

The zero-based index position of the value parameter if that string is found, or -1 if it is not.
Exceptions
ExceptionDescription
System.ArgumentNullExceptionvalue is null.
System.ComponentModel.InvalidEnumArgumentExceptionsearchDirection is not a valid value. />
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also