Returns the nearest index of an item in the AComboBox control that has text starting with the specified sItem.
[ lFindItem = ] Object.FindItem ( lStartIndex, sItem )
The FindItem method syntax has the following parts:
Name |
Type |
Description |
Object |
AComboBox |
A ComboBox control |
lStartIndex |
Val Long |
Returns or sets the zero-based index of the item before the first item to be searched. When the search reaches the bottom of the list, it continues from the top of the combo box back to the item specified by the parameter. If lStartIndex is -1, the entire combo box is searched from the beginning. |
sItem |
Val BString |
The text string being searched. |
lFindItem |
Long |
The return value is the zero-based index of the matching item in the combo box. If the return value is -1, the search was unsuccessful. |
The search is case independent.
The following example will find the text string "oranges" by value in the entire AComboBox and will return the index in the string, if found:
lcb1StartIndex = cb1.FindItem(-1, "oranges")