Keeping invisible forms from showing at start-up



The following code is part of my Delphi project file:

Application.CreateForm(TfmOrt560, fmOrt560);
if ( (ParamCount = 0) or (ParamStr(1) = '!') ) then begin
fmOrt560.Show;
// Show splash screen until OnClick event hides form
While fmOrt560.Visible do begin
Sleep(100);
Application.ProcessMessages;
end;
end;
fmOrt560.Release;
Application.CreateForm(TfmOrtDebug, fmOrtDebug);
Application.CreateForm(TfmOrtComm, fmOrtComm);
Application.CreateForm(TfrmCalibration, frmCalibration);
Application.CreateForm(TForm1, Form1);
... More forms

I have set Form1 as my Main Form. I create the other three first because
Form1 uses parts of them at initialization, for which I used the loaded
method. Originally, I only created and released fmOrt560 inside the if
statement, but then the fmOrtDebug would show on top if fmOrt560 was not
created, although its visible property was set to false. Its OnShow event
was triggered by Form1.OnShow, which happens after my initialization is
complete.

It seems like I have to create another form first to keep this from
happening.

Maybe its a D4 glitch. I saw in Help that there was a change in creation
order from D3 to D4.

--
Paul E. Schoen, President
P S Technology, Inc.
Cockeysville, MD
www.pstech-inc.com


.


Quantcast