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

# TControl.FindSubComponent

Finds the sub-component with the specified name in the Components property.

## Declaration

Source position: controls.pp line 1710

`public function TControl.FindSubComponent(`
`AName: string`
`):TComponent;`

## Arguments

`AName` |  | Parentage/path for the sub-component to retrieve in the method.

## Function result

The component with the specified name, or Nil when not found.

## Description

FindSubComponent is a TComponent function used to get the sub-component with the name specified in AName. FindSubComponent is similar to TComponent.FindComponent, but accepts a prefixed component name in AName. For example: 'LabeledEdit1.EditLabel'.

FindSubComponent separates the value in AName into the owner and sub-component names. When a prefix is used, the FindComponent method is called to locate the TComponent instance with the owner name. Its FindComponent method is called to get the component with the sub-component name that is used in the return value. If a prefix is not used, the initial component is used as the return value.

The return value is Nil if a component is not found with the specified name.

## See also

TComponent.FindComponent
TComponent.Components