1
votes

Delphi 10.3.3

In a mobile FMX project, I want to create a form before the main form.

This form contains app tethering components that talk to Codesite. It must be created first so that the main form's FormCreate() can use it.

However, making this form first causes it to become the main form.

How do I create a form before all other forms but not have it become the main form?

1
Perhaps it's different in FMX but in VCL you just create it by calling the constructor rather than Application.CreateForm.David Heffernan

1 Answers

3
votes

Use a TDataModule to host those tethering components, instead of a form. In your project file (.dpr) move the creation of the data module before the main form. Its setup code will run before the main form and the components will be available at the time of the main forms OnCreate.

TDataModule is frame work neutral and has a property called ClassGroup, that defines the framework. It controls which components are selectable in the tool palette.