Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Form appears after 'Application.CreateForm' step

Tags:

delphi

I am working on a project in delphi 2007 (CodeGear RAD Studio). There are couple of forms in the application. Thouse forms are created as follows:

program MyProgram;

uses
    Forms,
    uMain in 'Source\uMain.pas'                 {MainForm},
    uSettings in 'Source\uSettings.pas'         {fSettings};

{$R *.res}

begin
    Application.Initialize;
    Application.CreateForm(TMainForm, MainForm);
    Application.CreateForm(TSettings, Settings);
    Application.Run;
end.

the problem is, that on line Application.CreateForm(TSettings, Settings); Settings form appears (not modal). And the question is why it is happening?.

I know that it is probably not enough information, but I am ready to provide some, if it is needed.

P.S. I am currently re-wrighting programm logic so settings form will be created only before it is about to appear, and after that delete it. Still, I would like to know the answer to this question.

like image 869
Olexandr Strelchenko Avatar asked Jul 26 '13 07:07

Olexandr Strelchenko


1 Answers

Your settings form's Visible property is set to true at design time, and thus it appears as soon as it's created.

like image 86
iMan Biglari Avatar answered Sep 20 '22 04:09

iMan Biglari