API:Vcl.ComCtrls.TComboBoxExStrings.IndexOf
Delphi
function IndexOf(const S: String): Integer; override;
C++
virtual int __fastcall IndexOf(const System::UnicodeString S);
Properties
| Type | Visibility | Source | Unit | Parent |
|---|---|---|---|---|
| function | public | Vcl.ComCtrls.pas Vcl.ComCtrls.hpp |
Vcl.ComCtrls | TComboBoxExStrings |
Description
Returns the position of a string in the list.
Vcl.ComCtrls.TComboBoxExStrings.IndexOf inherits from Vcl.StdCtrls.TCustomComboBoxStrings.IndexOf. All content below this line refers to Vcl.StdCtrls.TCustomComboBoxStrings.IndexOf.
Returns the position of a string in the list.
Call IndexOf to obtain the position of the first occurrence of a string that matches S. The string must be an exact match (S can't be the prefix of a string in the combo box).
IndexOf returns the 0-based index of the string. Thus, if S matches the first string in the list, IndexOf returns 0, if S is the second string, IndexOf returns 1, and so on. If the string does not have a match in the string list, IndexOf returns -1.