Improve company productivity with a Business Account.Sign Up

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 210
  • Last Modified:

Im unsure how to create a decent "Idle" procedure for delphi for a splash/logon screen

Im trying to use an OnClick event on splash screen as my logon.
The application should open up to the splash screen and wait for the user to click the image on it before it opens up the logon window.
If they then click cancel on logon I want it to just go an sit back at the splashscreen and wait, rather than continue.
If they click OK and the login is fine, I then want the splash to hide and the app to start.

My main issue is with the "Idle" time.
Im not sure how to just make the application sit and do nothing
  • 3
  • 2
1 Solution

   In Project / Options / Auto-create forms remove your application MainForm - let's say it is frmMain and leave only the SplashForm - let's name it frmSplash.

   Close the frmMain on start up and when whe user press Login - then Show it
mikelittlewoodAuthor Commented:
So if I hide the splash screen when they login, and then on the OnClose event of the main form, do frmSplash.Show again to repeat the process

Ill give this a try

Thanks again Ivanov
mikelittlewoodAuthor Commented:
I forgot to mention that I would like it to go back to the splashscreen once they close the frmMain again
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Ferruccio AccalaiSenior developer, analyst and customer assistance Commented:
In your splash form assign to the OK button the ModalResult mrOK and to Cancel mrCancel....

then in your project file do this:

program Project1;

  uSplashScreen in '..\uSplashScreen.pas' {SplashForm},
  UMAinForm in '..\UMAinForm.pas' {MainForm};

{$R *.res}

  Application.CreateForm(TSplashForm, SplashForm);
  If SplashForm.ModalResult <> 1 then halt;
  Application.CreateForm(TMainForm, MainForm);
Ferruccio AccalaiSenior developer, analyst and customer assistance Commented:
--> I forgot to mention that I would like it to go back to the splashscreen once they close the frmMain again

procedure TMainForm.FormClose(Sender: TObject; var Action: TCloseAction);
mikelittlewoodAuthor Commented:
In the end I used my splash screen to handle the application.
Click on my splash screen image and it opens a logon form.
With a correct logon it hides the splash and then creates my main datamodule and main form.
When I close the main form I just frmSplash.Show again

Seems to work fine (unless there is something I should be careful of that I have forgotten.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now