[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'Controls' (#lcl)

# TWinControl.ParentHandlesAllocated

Returns True if all Parents have handles allocated, and are not being destroyed.

## Declaration

Source position: controls.pp line 2430

`public function TWinControl.ParentHandlesAllocated: Boolean; override;`

## Function result

True when all of the controls in the Parent hierarchy have a valid handle.

## Description

ParentHandlesAllocated is an overridden method in TWinControl which checks whether Handles are valid for all controls in the component hierarchy for the current control.

ParentHandlesAllocated visits each of the controls, starting with the current class instance, and checks whether the control has an allocated handle and is not being destroyed. It navigates to the next Parent control in the hierarchy, and exits when the Parent control is unassigned.

The return value is True when all of the controls in the hierarchy have an allocated Handle and are not being destroyed. The return value is False if any control is found in the hierarchy that does not have a valid handle allocated, or ComponentState indicates its handle is being freed.

## See also

TWinControl.HandleAllocated |  | Checks whether a handle for the widget has been allocated for the control.
TWinControl.Handle |  | A reference handle to the widgetset class instance associated with this control.
TControl.Parent |  | The control within which the control is shown.
TControl.ParentHandlesAllocated |  | Returns True if all Parents have allocated handles, and are not being destroyed.