Solved

ProgressBar while opening a form.

Posted on 1998-09-17
8
288 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
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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Windows Drag & Drop Location 2 100
Delphi Mdi application Child forms get behind control 7 207
select query - oracle 16 100
Delphi: Connect to running MS Outlook 4 77
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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

815 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

13 Experts available now in Live!

Get 1:1 Help Now