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

# TCustomForm.CreateNew

Creates a form instance without a resource (.lfm) file.

## Declaration

Source position: forms.pp line 697

`public constructor TCustomForm.CreateNew(`
`AOwner: TComponent;`
`Num: Integer = 0`
`); virtual;`

## Arguments

`AOwner` |  | Owner for the new class instance.
`Num` |  | Ignored in the current implementation.

## Description

CreateNew is an alternate constructor for the class instance. CreateNew is used to create a new TCustomForm instance which is not loaded from a resource file (.lfm). It performs actions to initialize properties for the form instance, including:

- Sets the FormState to fsFirstShow and calls BeginFormUpdate.
- Sets the default BorderIcons for the form.
- Sets the FormStyle, ControlStyle, and BorderStyle for the form.
- Calls the inherited Create constructor.
- Sets the default bounds for the form instance.
- Sets Visible to False.
- Sets WindowState to wsNormal.
- Allocates resources for the Icon property but does not assign a bitmap.
- Sets the default value for Color.
- Calls Screen.AddForm to register the form instance on the current screen.
- Allocates resources for the SnapOptions property.