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

# TComponent.SetName

Write handler for Name property.

## Declaration

`protected procedure TComponent.SetName(`
`const NewName: TComponentName`
`); virtual;`

## Description

SetName is the write handler for the Name property. It checks whether the desired name is valid (i.e is a valid identifier) and is unique among the children of the owner component. If either conditions is not satisfied, an exception is raised.

## See also

TComponent.Name |  | Name of the component.
TComponent.ValidateRename |  | Called when a name change must be validated