Home > Back-end >  Various Delphi great god help see..
Various Delphi great god help see..

Time:09-23

Procedure TMainForm. FormCreate (Sender: TObject);
The begin
If FileExists (ExtractFilePath (Paramstr (0)) + 'config. Ini') then
The begin
ShowMessage (' file already exists)
End
The else
The begin
ClientMainChild. ShowModal;//open the child form
end;
end;


//I want to in judgment when the form is the configuration file exists, if there is directly read, if not, you can open a child form, set and then write the configuration file, now even not achieve the first step, it is always wrong, and novice learning,,, please show!

CodePudding user response:

You write wrong will happen, of course, if the create, you didn't create to open the window, and then you will showmodel is not an error?

CodePudding user response:

In the code (ClientMainChild. ShowModal; Add: before//open the child form) ClientMainChild:=TFORM. CREATE (APPLICATION);

CodePudding user response:

Use onformshow

CodePudding user response:

MDI child window, should be created, and then, according to

Specifically,
1, open an MDIForm before, should check whether the window has been opened,
2, the size of the opening, make it the default display
3, did not open, create it and display,
  • Related