<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
 <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
 </head>
 <body>
  <p style="margin: 0pt;">
   <span>
    <span></span>
   </span>
  </p>
  <p style="margin: 0px; "></p>
  <div style="margin: 5px 0px;">
   <br/>
   Andreas Schneider <aksdb@gmx.de> hat am 17. Januar 2012 um 16:08 geschrieben:
   <br/>
   <br/>
   > On Tuesday, January 17, 2012, at 13:15 Felipe Monteiro de Carvalho wrote:
   <br/>
   > > If the use case is closing the main form without quitting the
   <br/>
   > > application, then I would prefer a property
   <br/>
   > > TApplication.QuitApplicationWhenMainFormCloses or something like that.
   <br/>
   >
   <br/>
   >
   <br/>
   > My current use case is:
   <br/>
   > - show a login form
  </div>
  <p>> - when login succeeds, show a progress form (connection  initialization) and close login </p>
  <div style="margin: 5px 0px;">
   > - on failure: go back to login
   <br/>
   > - on success: show the actual application form and close the login form
  </div>
  <p style="margin: 0px;"> </p>
  <p style="margin: 0px;">Instead of Application.CreateForm create the form directly. For example:</p>
  <p style="margin: 0px;"> </p>
  <p style="margin: 0px;">LoginForm:=TLoginForm.Create(nil);</p>
  <p style="margin: 0px;">while LoginForm.ShowModal<>mrOk do ;</p>
  <p style="margin: 0px;">LoginForm.Free; </p>
  <p style="margin: 0px;">... </p>
  <p style="margin: 0px;">Application.CreateForm(Form1); </p>
  <p style="margin: 0px;"> </p>
  <p style="margin: 0px;"> </p>
  <div style="margin: 5px 0px;">
   >
   <br/>
   > Showing the "main" form always wouldn't seem nice. Starting the application with the
   <br/>
   > mainform hidden doesn't work afaik. You can hide it manually AFTER it was shown (.Hide),
   <br/>
   > but Visible=False is ignored on startup. This just doesn't look nice if the main form
   <br/>
   > pops up for a second to be hidden again. So I use the workflow described above, which
   <br/>
   > changes the current Application.MainForm several times.
  </div>
  <p style="margin: 0px;"> </p>
  <p style="margin: 0px;"> </p>
  <p style="margin: 0px;">Mattias</p>
  <p style="margin: 0px;"> </p>
 </body>
</html>