RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TComponentList.IndexOf Method

Returns the index of the first component in the list with a specified value.

Pascal
function IndexOf(AComponent: TComponent): Integer;
C++
__fastcall int IndexOf(TComponent * AComponent);

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. 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!