How can I not show my main fmx application form? [duplicate]

  

This question already has an answer here:

Show login form before main form

1 answer

I’m writing a program in Delphi for school. Because it has a login screen, which is Form2, Form1 should be hidden at start.

On multiple forums I’ve read that you should use Application.ShowMainForm := False;. I’ve put this line directly after Application.Initialize;. Also, Form1’s visible attribute is set to false.

It gives me this error:

“‘TApplication’ does not contain a member named ‘ShowMainForm’ at line 14 (14;15)”.

I’m programming in Delphi 10.3

program Project2;

uses
System.StartUpCopy,
FMX.Forms,
Unit1 in ‘Unit1.pas’ {Form1},
Unit2 in ‘Unit2.pas’ {Form2},
Unit3 in ‘Unit3.pas’ {Form3};

{$R *.res}

begin
Application.Initialize;
Application.ShowMainForm := False;
Application.CreateForm(TForm1, Form1);
Application.CreateForm(TForm2, Form2);
Application.CreateForm(TForm3, Form3);
Application.Run;
end.

I expected the program to start with Form1 hidden, but the program won’t start because of the error.

Edit: Changed the title on recommendation of @Sertac Akyuz

Comments are closed.