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

# TCustomForm.DoCreate

Notifies the create handlers for the form instance.

## Declaration

Source position: forms.pp line 641

`protected procedure TCustomForm.DoCreate; virtual;`

## Description

DoCreate is a method used to signal the create handlers for the form instance. DoCreate signals the OnCreate event handler (when assigned) to perform any actions needed for the new form instance. DoCreate also signals other create handlers to perform the methods using the current form instance as an argument.

If an Exception occurs in one of the event handlers, it is handled in the method when HandleCreateException returns True. When it returns False, the exception is re-raised in the method.

DoCreate calls LockRealizeBounds on entry to disable sending bounds changes to the widgetset class. UnlockRealizeBounds is called prior to exit to re-enable sending bounds changes to the widgetset class.

DoCreate is a called from the AfterConstruction method after the initial bounds for the form have been set, and before scaling and automatic layout adjustment are performed (if needed) for the new form instance.

## See also

TCustomForm.OnCreate |  | Handler called when the form has been created.
TCustomForm.HandleCreateException |  | Indicates if an exception in the OnCreate event handler is handled by the application.
TCustomForm.AfterConstruction |  | Performs actions when the form has been created and loaded from its resource file.
TFormHandlerType |  | TForm Notification handler types.
TWinControl.LockRealizeBounds |  | Disables sending bounds to the widget, by incrementing the internal FRealizeBoundsLockCount.
TWinControl.UnlockRealizeBounds |  | Enables sending bounds to the widget again, eventually updates the widget.