Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Progrss Bars

Posted on 1998-04-16
4
Medium Priority
?
173 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 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

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…
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…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

972 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