RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TControlCollection.IndexOf Method

Returns the index of the first control in the Items array with a specified value.

Pascal
function IndexOf(AControl: TControl): Integer;
C++
__fastcall int IndexOf(TControl * AControl);

Call IndexOf to get the index for a control in the Items array. Specify the control as the AControl parameter.  

The first item in the array has index 0, the second item has index 1, and so on. If a control item is not in the list, IndexOf returns -1. If a control item appears more than once in the array, IndexOf returns the index of the first appearance. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!