Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
Solved

Posted on 1998-04-16
Medium Priority
171 Views
What coding do you have when useing progress bars
0
Question by:hannes
[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

Expert Comment

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.

0

LVL 1

Expert Comment

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

0

LVL 5

Expert Comment

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

Edo082297 earned 400 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

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 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…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
###### Suggested Courses
Course of the Month8 days, 6 hours left to enroll