RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TComponentList.Items Property

Lists the component references.

Pascal
property Items [Index: Integer]: TComponent;
C++
__property TComponent * Items[int Index];

Use Items to access components in the list. Items is a zero-based array: The first component is indexed as 0, the second component is indexed as 1, and so forth. You can read or change the value at a specific index, or use Items with the Count property to iterate through the list. 

If OwnsObjects is true, reassigning an Items value frees the component that previously occupied that position in the list. 

Items can contain nil (Delphi) or NULL (C++) references. To remove nil (Delphi) or NULL (C++) references and reduce the size of the array, call the Pack method.

Note: In Delphi, Items is the default property of TComponentList. This means that the property name can be eliminated in code that uses this property. Thus, the following two lines are both acceptable and do the same thing:

     ComponentList1->Items[i] := Screen.CustomForms[i];
     ComponentList1[i] := Screen.CustomForms[i];

Note: In C++, Items can be accessed using the [] operator, to achieve an affect similar to the default property in Delphi.
 

OwnsObjects 

Add 

Insert 

Delete 

Remove 

List 

Extract 

Extract 

Count 

Clear 

Pack 

operator_sb

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