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

# TControl.CheckChildClassAllowed

Returns True if the class is allowed for child controls.

## Declaration

Source position: controls.pp line 1722

`public function TControl.CheckChildClassAllowed(`
`ChildClass: TClass;`
`ExceptionOnInvalid: Boolean`
`):Boolean;`

## Arguments

`ChildClass` |  | The class of the intended child control.
`ExceptionOnInvalid` |  | When True, raise an exception when the class is not allowed.

## Function result

True if the class is allowed for child controls.

## Description

Only few controls restrict the class of acceptable child controls. E.g. a PageControl only accepts TTabSheet descendants as children.

## Errors

An EInvalidOperation can be generated (see ExceptionOnInvalid).