function CreateCustomForm(const ClientWidth, ClientHeight: Integer; const KeepSizeX, KeepSizeY: Boolean): TSetupForm;
Creates a form. The form is empty by default; you have to create your own controls afterward and place them on the form (by setting their Parent properties to the TSetupForm instance returned by this function).
You should call this function instead of creating TForm or TSetupForm instances directly. This function automatically initializes the font and other properties of the created form to be like Setup's other dialogs.
The [LangOptions] section's DialogFontName and DialogFontSize directives determine the font used by the form and, by default, any child controls created on the form.
You should use ScaleX and ScaleY to scale the desired client width and height to appropriate values. A form's client width and height are the form's full width and height minus its borders.
KeepSizeX and KeepSizeY specify whether the form is allowed to grow horizontally and vertically as the client area is resized, for [Setup] section directive WizardSizePercent.
The signature of the CreateCustomForm function has changed as of version 6.6.0. The width and height must now be specified upfront (they are now read-only properties once the form is constructed). Previously, your code might have looked like this:
Form := CreateCustomForm; Form.Caption := 'TSetupForm'; Form.ClientWidth := ScaleX(256); Form.ClientHeight := ScaleY(128);
Starting with version 6.6.0, it should be updated as follows:
Form := CreateCustomForm(ScaleX(256), ScaleY(128), False, False); Form.Caption := 'TSetupForm';
The same applies to the KeepSizeX and KeepSizeY properties, which were writable properties before version 6.6.0, but are now specified as parameters when calling CreateCustomForm and are read-only properties afterwards.
See CodeClasses.iss for an example.