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

# TCustomForm.AddHandlerCreate

Adds a handler for a form create event.

## Declaration

Source position: forms.pp line 749

`public procedure TCustomForm.AddHandlerCreate(`
`OnCreateHandler: TNotifyEvent;`
`AsFirst: Boolean = False`
`);`

## Arguments

`OnCreateHandler` |  | Form create handler added in the method.
`AsFirst` |  | True if the handler is stored as the first entry in the list of form create handlers.

## Description

AddHandlerCreate is a method used to add the TNotifyEvent handler specified in OnCreateHandler to the list of form handlers for the type. It allows a form instance to have additional event handlers which behave just like the OnCreate event handler.

AddHandlerCreate calls the AddHandler method to create the TMethod entry used to represent the handler routine. When AsFirst is True, the routine in OnCreateHandler is inserted as the first item in the list of form create handlers.

Applications must implement and assign an object procedure using the signature in TNotifyEvent to perform actions needed when the form instance has been created and its bounds have been assigned.

A handler added using AddHandlerCreate is signalled after the OnCreate event handler for the form instance.

Use RemoveHandlerCreate to remove a form create handler added in the method.

## See also

TCustomForm.Create |  | Constructor for the class instance.
TCustomForm.OnCreate |  | Handler called when the form has been created.
TCustomForm.AfterConstruction |  | Performs actions when the form has been created and loaded from its resource file.
TCustomForm.Destroy |  | Destructor for the class instance.
TCustomForm.RemoveHandlerCreate |  | Removes a form create handler added to the form instance.
TNotifyEvent