How can I hide the MainForm?

MutantX
MutantX used Ask the Experts™
on
Hi all,

How can I hide the MainForm? When I do Form1.Visible := False I get an error.

Thanks in advance!
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
that's easy ;-)

just put this in FormCreate:

begin
 ShowMainForm := False;
end;
Commented:
i mean:

begin
 Application.ShowMainForm := False;
end;
Top Expert 2004

Commented:
open your project-file-Source->menu Project|View Source,
change it as you see here

program Project1;

uses
  Forms,
  Unit1 in 'Unit1.pas' {Form1},
  Unit2 in 'Unit2.pas' {Form2};

{$R *.RES}

begin
  Application.Initialize;
  Application.ShowMainForm := False;  // <- add this line
  Application.CreateForm(TForm1, Form1);
  Application.CreateForm(TForm2, Form2);
  Application.Run;
end.

hope this helps

meikl ;-)
CompTIA Security+

Learn the essential functions of CompTIA Security+, which establishes the core knowledge required of any cybersecurity role and leads professionals into intermediate-level cybersecurity jobs.

Author

Commented:
wow! that's quick! it really works!

thank you very much!

MutantX

Author

Commented:
sorry kretzschmar, must have been typing my reply when you posted yours. sorry again...
but thanks anyway :)
Top Expert 2004

Commented:
no problem,
pika was first,
so he/she deserves the points

meikl ;-)

Commented:
wow, that are quit a lot of points :-)
thx a lot MutantX!
and you too kretzschmar ;-)
and by the way... i'm a 'he'... LOL :-D

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial