[Tutorial] Progress bar in Delphi

A Place For Programmers Of All Levels To Discuss Programming & Web Building.

Moderator: Community Moderator

Post Reply
User avatar
djfshady
Corporal
Corporal
Posts: 25
Joined: 26 Nov 2010, 20:12
Location: United Kingdom
Been thanked: 5 times
Contact:

[Tutorial] Progress bar in Delphi

Post by djfshady »

If you post this on another forum remember to give credits.
Hello, in this tutorial i will show you how to make a progress bar in delphi.

What you will need:
1 progress bar
1 timer
1 button

Okay, first lets add the progress bar which can be found here:
Image

Next lets add the timer which is here:
Image

And finally lets add in the button:
Image

Your program should now look similar to this:
Image

Now time for the coding. Double click your timer1 and type in the following code:

Code: Select all

progressbar1.Position := progressbar1.Position+2; //you may change the value of 2
if progressbar1.Position=100 then // you may also change the 100 value to anything you want
timer1.enabled := false;
//You may add your choice of code here messagebox etc.
Now click your button1 and type in this:

Code: Select all

timer1.enabled :=true
Now click your timer and look on the left hand side and click the drop down menu next to enabled and click false.

And your done if you run your program by pressing the triangle here:
Image

or by pressing F9 , when you click your button1 it should start counting up the progressbar.

Hope you enjoyed my tutorial :)
Image
Post Reply

Return to “Programming/Web Building Chat & Support”