Solved

Progrss Bars

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

679 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