Solved

Progrss Bars

Posted on 1998-04-16
4
165 Views
Last Modified: 2010-04-06
What coding do you have when useing progress bars
0
Comment
Question by:hannes
4 Comments
 

Expert Comment

by:BigMadDrongo
ID: 1361578
What exactly are you trying to do with a progress bar?  The basics of it are you set the max and min values for the maximum and minimum value you wish to display (i.e. for percent complete you could set min to 0 and max to 100), and the value property is how much of the bar is filled in (i.e. if you had max as 100, min as 0, if you set value to 50, the bar will be half filled).  If you want to knoe any more, leave a comment.

   BigMadDrongo
0
 
LVL 1

Expert Comment

by:mrider
ID: 1361579
hmmm, what do you mean "coding"?
you need example of growing brogess bar?

0
 
LVL 5

Expert Comment

by:JimBob091197
ID: 1361580
BigMadD is right, except that in D3 (and D2??) you must use the Position property, not Value.  E.g. MyProgressBar.Position := 50;

JB
0
 
LVL 1

Accepted Solution

by:
Edo082297 earned 200 total points
ID: 1361581
Hi Hannes,

   To use a progress bar, you have to (as the others have said) set a max and a min. The min will usually be 0, and the max will be a value that makes sense depending on what exactly you want to do. You also set is the Step property, which is really key to how this component works.
  Let's take a look at an example. Say you have a loop which takes a long time to execute. Maybe you want to display a progress bar to show the user how much there is left to do. What you would do is the following:

- Create a new form and drop a progress bar on it
- put this new form in the uses clause of the form that will diplay the progress bar
- set the Step value - 1 in our case, and the max and min values (0 and 100)

 (This assumes that you want a seperate form with a progress bar on it. The ideas remain the same no matter where the progress bar is, however).

Now, let's say that your process occurrs in a for loop of 1 to 100. This is what you would do:

Application.Create(TProgressForm, ProgressForm);
for i := 0 to 99 do
begin
  // lots of processing
  ProgressForm.ProgressBar.StepIt;
end;
ProgressForm.Free;

So now at each iteration of the loop, the progress bar will increment by one, and indicate to the user how much processing is left to do: when the StepIt method is called, the value of Position increases by Step.
  I am writing this quickly, and haven't tested it. There are details to fill in, but this should give you an idea of what to do.

Regards,

Edo






   Let's say you
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

911 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

20 Experts available now in Live!

Get 1:1 Help Now