FindText()

Finds the zero based index of the first occurence of the specified string.

Syntax
c#
public int FindText(string text, int StartIndex)
{ 
}

Parameters
Parameter Name Type Description
text System.String The string to search for
StartIndex System.Int32 The zero based index where searching should start from in the string.


Return Value
Returns an integer that defines the zero based index where the string starts.

Remarks
The FindText method will search within the text of the control for the first occurence of the specified string. To find all occurences of the specified string you can use the FindAllInstancesOfText() method.

Examples

c#
// Find the occurence of the string within the textbox control from the start of the text.
public int FindString(SGBTextBox textBox, string searchValue)
{
    if(control != null)
    {
          return textBox.FindText(searchValue, 0);
    } else return -1;
}

vb.net
' Find the occurence of the string within the textbox control from the start of the text. 
Public Function FindString(ByVal textBox As SGBTextBox, ByVal searchValue As String) As Integer 
    If control IsNot Nothing Then 
        Return textBox.FindText(searchValue, 0) 
    Else 
        Return -1 
    End If 
End Function 

Known Issues
none

Last edited Mar 30, 2010 at 1:08 PM by scottgblood, version 2

Comments

No comments yet.