Solved

ProgressBar while opening a form.

Posted on 1998-09-17
8
291 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
[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
  • 2
  • 2
  • 2
  • +2
8 Comments
 

Author Comment

by:yngvi
ID: 1340028
Adjusted points to 150
0
 
LVL 4

Expert Comment

by:erajoj
ID: 1340029
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
ID: 1340030
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
Technology Partners: 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!

 
LVL 2

Expert Comment

by:333
ID: 1340031
Hi,
can't you use DBProgress component from RxLibrary?

A.
0
 

Accepted Solution

by:
sakya earned 150 total points
ID: 1340032
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
ID: 1340033
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
ID: 1340034
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
ID: 1340035
John, don't worry. Just keep on going...   :-)
0

Featured Post

Technology Partners: 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!

Question has a verified solution.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

728 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