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:
Next lets add the timer which is here:
And finally lets add in the button:
Your program should now look similar to this:
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.
Code: Select all
timer1.enabled :=true
And your done if you run your program by pressing the triangle here:
or by pressing F9 , when you click your button1 it should start counting up the progressbar.
Hope you enjoyed my tutorial
