System.Contnrs.TComponentList.IndexOf
Delphi
function IndexOf(AComponent: TComponent): Integer; inline;
C++
HIDESBASE int __fastcall IndexOf(System::Classes::TComponent* AComponent);
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | public | System.Contnrs.pas System.Contnrs.hpp |
System.Contnrs | TComponentList |
Description
Returns the index of the first component in the list with a specified value.
Call IndexOf to get the index for a specified component in the list.
AComponent is the component to locate in the list.
Index of returns the index of AComponent, where the first component has index 0, the second component has index 1, and so on. If a component is not in the list, IndexOf returns -1. If a component appears more than once, IndexOf returns the index of the first appearance.