Solved

ProgressBar while opening a form.

Posted on 1998-09-17
8
285 Views
Last Modified: 2010-04-06
I need to know how I can display progress in the progressbar while the user is opening a Form.
The form contains database data and it takes 15 sec to load. I want the progressbar to tell the user how much is left for the form to show.

thanx Yngvi Thor
 
0
Comment
Question by:yngvi
  • 2
  • 2
  • 2
  • +2
8 Comments
 

Author Comment

by:yngvi
Comment Utility
Adjusted points to 150
0
 
LVL 4

Expert Comment

by:erajoj
Comment Utility
Hi,
You have to provide more info.
The way to do it is probably using a thread.
How can you get progress from the DB form? I.e. how do you know what record you're on and how many there are?

/// John
0
 
LVL 20

Expert Comment

by:Madshi
Comment Utility
Yngvi,

I guess the 15 seconds come from what you do in FormCreate, or am I wrong?

procedure RefreshProgressBar(percent: integer);
begin
  ...
end;

procedure FormThatTakes15secToOpen.FormCreate(Sender: TObject);
var i1       : integer;
    progress : integer;
begin
  progress:=0;
  for i1:=0 to 999 do begin
    inc(progress);
    RefreshProgressBar;
    ... // don't know what you're doing that takes 15 sec.
        // I'm not familiar with database programming...
  end;
  for i1:=0 to 999 do begin
    inc(progress);
    RefreshProgressBar(progress*100 div 2000);
    ...
  end;
end;

Hope this helps, Madshi.
0
 
LVL 2

Expert Comment

by:333
Comment Utility
Hi,
can't you use DBProgress component from RxLibrary?

A.
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Accepted Solution

by:
sakya earned 150 total points
Comment Utility
Hello.

Would you like a code as follows?

--------------------------------------------
procedure TForm1.FormCreate(Sender: TObject);
var
 i: integer;
begin
 Form2 := TForm2.Create(Application);
 Form2.Show;
 Form2.Update;
 for i := 0 to 100 do
 begin
  { your procedure }
  Form2.Gauge1.Progress := i;
 end;
 Form2.Release;
end;
-------------------------------------

Form2 has the Gauge.
You must change Form2  to a selective form.

Sakya


0
 
LVL 4

Expert Comment

by:erajoj
Comment Utility
I wonder sometimes why I bother helping people here, when EVERYBODY else have soo much more to offer and are soo much better at formulating it.

/// John
0
 

Author Comment

by:yngvi
Comment Utility
Thank you very much...

This informtion gave me an idea that helped me to complete the progress bar.. Also a special thanx to Madshi who gave an excellent comment.

Yngvi Thor.
0
 
LVL 20

Expert Comment

by:Madshi
Comment Utility
John, don't worry. Just keep on going...   :-)
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

772 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now