property Controls[Index: Integer]: TControl;

Run-time and read only. The Controls property is an array of all controls that are children of the control. The Controls property is most useful if you have a need to refer to the children of a control by number rather than name.

Don't confuse the Controls property with the Components property. The Components property lists all components that are owned by the component, while the Controls property lists all the controls that are child windows of the control. All components put on a form are owned by the form, and therefore, they appear in the form's Components property list.

For example, if you put a control in a group box, the form still owns the control, but the control's window parent is the group box control, and therefore, is listed in the group box's Controls property array.

0 0

Post a comment