Solved

ProgressBar while opening a form.

Posted on 1998-09-17
8
290 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

Independent Software Vendors: 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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

738 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