[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

splash screens

Posted on 2002-05-03
8
Medium Priority
?
337 Views
Last Modified: 2010-04-04
Hello! I would like to create a splash screen, but I don't know how. I've tried to write it, but it doesn't works! Please give me some ideas, how to write it! Thanks!
0
Comment
Question by:Zed20
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 8

Accepted Solution

by:
Cesario earned 400 total points
ID: 6988085
Tutorials  
Implementing a Splash Screen  


What is a Splash Screen?
A splash screen is a form that is displayed when an application is first starting to inform the user that the program is actually doing something even though you can not see this. Like connecting to database, creating many forms, etc. The most basic splash screen is just an image that appears in the centre of the screen when
the application is loading and then disappears when it has loaded.

Why use a Splash Screen?
A Splash Screen adds a professional touch to an application without adding an excessive amount of work, for shareware programs it is also a good place to remind users to register the package.

How To
The first stage is to produce the form that you wish to display. You can have anything that you like on this, with the norm being an image and some text underneath it, indicating what stage of loading the application is at. Create a new form, and change the following properties:

Name          SplashV
Position      poScreenCenter
BorderStyle   bsNone
 

Next add a Label to the form aligned alBottom, and change its caption property to 'My Application Loading' or whatever you prefer Also add an image to the form and align this alClient. Change the picture
property of the image to whatever image you wish displayed. Now is a good time to resize the form, so that the image and caption fit in as you want them. If neckwear you can change the auotosize property of the image to true, so that your image fills the entire form (apart from the caption area) but make sure the image still looks good when it has been re sized.

You are now at the stage where you want to be adding the splash screen to your application. Add the SplashV form as you would any other (Add to project from the file menu) You now need to modify the dpr file so that the form is not auto created. This is done by removing the command
  Application.CreateForm(TSplashV,SplashV);

from the dpr file of your application. Next you have to modify the dpr file so that SpashV is created and
then displayed, and also before the application runs the splash screen is hidden and destroyed.
This is done by adding the following lines straight after the begin of the dpr file:

(* Create the splash Screen *)
SplashV := TSplashV.Create(Application);
(* Show the splash Screen *)
SplashV.show;
(* Update the splash Screen so that all components on it are visible*)
SplashV.update;

Finally before the application.run statement in the dpr file add the following:

(* Hide the splash screen from the user *)
SplashV.hide;
(* Free any resources that it used*)
SplashV.free;

If you wish to modify the splash screen to inform the user of the progress of the application loading, add the following sort of lines in the relevant section of the dpr file:

(* Change the caption to indicate connecting to the database *)
SplashV.label1.caption:=' Connecting to the Database;
(* Update the splash Screen so that all components on it are visible and up to date*)
SplashV.update;

 

Conclusion

You should now have an application complete with splash screen, I will leave it to you to modify this to suit your needs e.g. checking if the user has registered you package and displaying a message accordingly, changing the image if your application takes a long time to start up, etc.

Hint

Whilst debugging you may find the splash screen obscures you code if you are stepping through it at start up. This can be resolved by adding a parameter to your program to indicate not to show the splash screen
e.g.
if not(ParamStr(1) = 'ns') then
begin
(* Code to display splash screen here *)
end;

NB Make sure that you do not access the splash screen later if it has not been created

0
 
LVL 8

Expert Comment

by:Cesario
ID: 6988089
The last postet Tutorial came form
http://delphi.about.com/library/weekly/aa030999.htm
0
 
LVL 8

Expert Comment

by:Cesario
ID: 6988094
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Expert Comment

by:EEchimp
ID: 6988126
have a look at my site (howto section)

http://people.zeelandnet.nl/cpmol/delphi/delphiindex.htm

Greetz,
Chris
0
 
LVL 11

Expert Comment

by:robert_marquardt
ID: 6988146
Previously asked question available for 10 points:
http://www.experts-exchange.com/delphi/Q.20294514.html
0
 
LVL 3

Expert Comment

by:tongalite
ID: 6988451
robert....
{Previously asked question available for 10 points}


Nicely put.
economics in action ;-)

tongalite.
0
 
LVL 3

Expert Comment

by:lopem
ID: 6989425
0
 

Author Comment

by:Zed20
ID: 6995733
Thank you, it is very usefull! I made it, and it works! Thanks a lot!
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question