My database takes quite some time to load (it is on network) so I thought to display a splash screen with some animation (progress bar or some simple animation) to keep the user occupied.Since it is everyone's guess when will the table open, so I can not use a timer for running the progress bar. So some animated gif is probably a better choice. However, how can I hide/free the splash screen just before the table opens (and main form shows) ???
-
1How do both XE-2 and D7 at once come into play here? – Günther the Beautiful Jul 24 '13 at 07:45
-
Do it in d7 and it will work on xe4 ... same thing ... – user763539 Jul 26 '13 at 02:33
-
Why was this 4 year old question put on hold now? That's not helpful. – dummzeuch Apr 27 '18 at 10:01
3 Answers
Splash screen implementation in Delphi Splash Screen Programatically in Delphi
How to animate a GIF in a Delphi Form How to use Animated Gif in a delphi form
How to display a splash screen with a progress bar How to make a splash screen with a progress bar on Turbo Delphi?
Anything else depends on what you want to do in your application.
Do you load in a complete database? Then you can show progress by number of tables / records loaded.
There are lots of examples that will show you how to add a splash screen. You can either just hide the mainform and show a (modal) form as splash-screen. This form is created before the database loading starts and destroyed when it is done.
I recommend a progressbar so that the user has an idea about how long he will have to wait.

- 4,343
- 21
- 35
-
I know how to add a splash screen.... What I would like to do is for my splash screen to go away as soon as the main form is ready (all tables opened). Progress bar must show progress but how does it know when the main form is about to be opened (so it should display 100%) ??? – user763539 Jul 26 '13 at 02:31
-
So you have some code that opens all the tables (do you really need to open them when the progam is started, or can that wait untill you actually need them...?). Anyway, at the end of the code that opens the tables you close the splash-screen and make the main-form visible. – Birger Jul 26 '13 at 07:47
you can use a Ttimer and update a TprogressBar inside until the loading is over .
for the the timer use the function "on timer" put the parameter interval to 500 ms
To finish when the loading is over make the TprogressBar not visible and the timer enabled value to false and finallely show your main form

- 116
- 1
- 6