[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 286
  • Last Modified:

Program loading progress indicator-How to

How to show the program loading through a progress indicator
component (Progreesbar/Gauge component)in the opening Splash screen form?
Is there a free component for such a purpose?
regards
venks
0
venks
Asked:
venks
  • 5
  • 3
  • 3
1 Solution
 
trilloCommented:
If I understand well, you want to show a progress bar while your project is loading... but if you are refering to the process of loading the MainForm, for example, you can't show a status bar....
A progress bar can be usefull if you are loading a lot of information from registry entries, initalization files, and data files... because you're program knows exactly how much has been loaded and how much hasn't,,, and you reflect this on a progress bar, but you can't handle a progress bar, for example, to show the progress of the loading process of a single form.

Trillo
0
 
BoRiSCommented:
venks

In your Project source add something like this, you will see my splash form is called SplashForm I create it first then show it then start the progress then update it, if you want me to send a full demo to you just leave your mail address...

begin
  Application.Initialize;
  Application.CreateForm(TSplashForm, SplashForm);
   SplashForm.Show;
   SplashForm.ProgressBar1.Position := 30;
   SplashForm.Update;
  Application.CreateForm(TForm1, Form1);
   SplashForm.ProgressBar1.Position := 60;
  Application.CreateForm(TForm2, Form2);
   SplashForm.ProgressBar1.Position := 90;
  Application.CreateForm(TForm3, Form3);
   SplashForm.ProgressBar1.Position := 100;
   SplashForm.Hide;
  Application.Run;
end.

Later
BoRiS
0
 
trilloCommented:
Boris... that's a good answer but It works only fine if you have at least 2 or 3 forms.... and I see that you set a value of 30 to the progress bar when the Splash screen is loaded... That's not a pretty good solution because when the Splash form is finished with loading the progress bar MUST IN THAT MOMENT START FROM 0, That is the purpose of the progress indicator....

Otherwise it's like tricky if you havo only two forms and one of them is the Splashscreen, you would then show two values.... 50% When Splash is loaded and 100% when Form1 is loaded.....  So you never show a 0% ??
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!

 
BoRiSCommented:
trillo

you are quite right there, but this is the only way I found to do it, I tried various ways and this is the only one that worked...

Later
BoRiS
0
 
venksAuthor Commented:
Dear Boris
I am rejecting your question for now becuse i have some doubts.
I will award you the points later on.
If there are 5 forms will the progressbar(in Gauge compo) show an increase of 20% after each form or will it show the exact percentage depending on each form's size.
I  have yet to try out your code.I will do that and get back to you.
Regards
venks
0
 
trilloCommented:
As you can see, Boris' answer could work fine if you're loading several forms... But you have to realize that you should enter the percentage values manually, that method won't do it automatically for you... This means that if you have, for example 5 forms, and only the first one is very huge and heavy you could assign values like:
form1   40%
form2   15%
form3   15%
form4   15%
form5   15%

You put these values depending on your own judgement.

Trillo
0
 
BoRiSCommented:
venks

No problem, try it out...as trillo mentioned the percentage must be done manually but it works and looks fine...

Later
BoRiS
0
 
venksAuthor Commented:
DEar Boris
I have tried out your code and it works.Even though  i have not got all the answers for my query i have to award the points to you.Can you post the answer so that i can award the points to you.
regards and thanks
venks
0
 
BoRiSCommented:
venks

Here is that answer, what else is it you need to know

Later
BoRiS

0
 
venksAuthor Commented:
Dear Boris
Thanks for the answer.Is it possible to find the file size and time to load each file for progress bar indication.
More over how are forms that are created at run time be accounted for
Thanks
venks
0
 
BoRiSCommented:
venks

Let me take a look at it and I'll get back to you...

Later
BoRiS
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

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