I have been trying to start my application with hiden main form, but no luck. It
compiles and everything, but when I run it I get runtime error. When I use timer and set it to 1 millisecond and then call Application.MainForm.Hide it hides but it flashes i dont want that to happen
program Project1;
uses
FMX.Forms,
Unit1 in 'Unit1.pas' {Form1};
{$R *.res}
begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.MainForm.Visible := false;
Form1.Visible:=false;
Application.Run;
end.
In a FireMonkey application the Auto-created forms (are created) and the
MainFormproperty is assigned in theApplication.Runmethod. So the access violation is caused because theMainFormproperty andform1variable is nil.In order to access such properties you must execute the
RealCreateFormsmethod first