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

# TWinControl.ChildClassAllowed

Checks whether the specified class type is allowed as a child control.

## Declaration

Source position: controls.pp line 2187

`protected function TWinControl.ChildClassAllowed(`
`ChildClass: TClass`
`):Boolean; override;`

## Arguments

`ChildClass` |  | Class type examined in the method.

## Function result

True when ChildClass is allowed in Controls.

## Description

ChildClassAllowed is an overridden method in TWinControl used to determine if instances of the class type in ClassType are allowed as child controls. Returns True if the specified class type is allowed as a child control in the Controls property.

In TWinControl, the return value is True when ChildClass has been assigned (not Nil) and the class type is derived from TControl.

ChildClassAllowed does not call the inherited method which always returns False.

ChildClassAllowed is called from the CheckChildClassAllowed method in TControl.

## See also

TWinControl.Controls |  | Provides indexed access to the child controls for the class instance.
TControl.CheckChildClassAllowed |  | Returns True if the class is allowed for child controls.
TControl.Parent |  | The control within which the control is shown.