Spread Windows Forms 15.0
GrapeCity.Win.PluginInputMan Assembly / GrapeCity.Win.Spread.InputMan.CellType Namespace / GcComboBox Class / FindString Method / FindString(String,Int32,String) Method
The System.String to search for.
The zero-based index of the item before the first item to be searched.
The System.String refer to the TextForamt.


In This Topic
    FindString(String,Int32,String) Method
    In This Topic
    Finds the first item after the given index which starts with the given string based on the specific TextFormat.
    Syntax
    'Declaration
     
    
    Public Overloads Function FindString( _
       ByVal s As String, _
       ByVal startIndex As Integer, _
       ByVal textFormat As String _
    ) As Integer
    'Usage
     
    
    Dim instance As GcComboBox
    Dim s As String
    Dim startIndex As Integer
    Dim textFormat As String
    Dim value As Integer
     
    value = instance.FindString(s, startIndex, textFormat)
    public int FindString( 
       string s,
       int startIndex,
       string textFormat
    )

    Parameters

    s
    The System.String to search for.
    startIndex
    The zero-based index of the item before the first item to be searched.
    textFormat
    The System.String refer to the TextForamt.

    Return Value

    The zero-based index of the first item found; returns -1 if no match is found.
    Exceptions
    ExceptionDescription
    The startIndex is out of range.
    The textFormat isn't a valid TextFormat.
    Remarks
    The search performed by this method is not case-sensitive. The s parameter is a substring to compare against the text associated with the items in the combo box list. The search performs a partial match starting from the beginning of the text, and returning the first item in the combo box list that matches the specified substring. You can then perform tasks, such as removing the item that contains the search text using the ListItemCollection.Remove method or changing the item's text. Once you have found the specified text, if you want to search for other instances of the text in the GcComboBox, you must use the version of the FindString(String,Int32,Int32) method that provides a parameter for specifying a starting index within the GcComboBox. If you want to perform a search for an exact word match instead of a partial match, use the FindStringExact(String,Int32,String) method.
    See Also