Search code examples
firemonkeysplash-screen

Splash Screen with message in FireMonkey


I want a splash screen with a tLabel on it. This tLabel will be used to show the progress of the initialization tasks for the application, such as: "Starting up databases", "Setting up forms", etc.

I have tried the following code, in the project file:

  Application.Initialize;
  FormSplash := TFormSplash.Create( Application );
  FormSplash.OpenSplash;
  FormSplash.ShowProgress;
  Application.Run;

It shows the splash-screen properly. However, the tLabel that should show each text posted to it in sequence when the splash-screen appears, shows only the last text posted. This happens even if I put a Sleep command after each text posted. I tried to post the texts on the FormCreate, FormShow and FormActivate events with the same result.

The application is for Windows 32.


Solution

  • Between changing the contents of your label you should allow the application to react to those changes. The simplest possibility is to use Application.ProcessMessages.