Solved

Progrss Bars

Posted on 1998-04-16
4
164 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

743 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

10 Experts available now in Live!

Get 1:1 Help Now