Spread WinForms 15
GrapeCity.Win.PluginInputMan Assembly / GrapeCity.Win.Spread.InputMan.CellType Namespace / GcComboBox Class / FindStringExact Method / FindStringExact(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 text foramt.


FindStringExact(String,Int32,String) Method
Finds the first item after the specified index that matches the specified string based on the specific TextFormat..
Syntax
'Declaration
 
Public Overloads Function FindStringExact( _
   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.FindStringExact(s, startIndex, 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 text foramt.

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 case-sensitive. The s parameter is a string to compare against the text associated with the items in the combo box list. The search looks for a match starting from the beginning of the text, . returning the first item in the 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. This method is typically used after a call has been made using the version of this method that does not specify a starting index. Once an initial item has been found in the list, this method is typically used to find further instances of the search text by specifying the index position in the startIndex parameter of the item after the first found instance of the search text. If you want to perform partial word search instead of an exact word match, use the FindString(String,Int32,String) method.

The search performed by this method is not circular. If the startIndex parameter itself is equal to the last index in the collection, an exception is thrown.

See Also