[TUT] how to make a REAL progress bar

Posts 1–6 of 6 · Page 1 of 1
[TUT] how to make a REAL progress bar
alright..there was already a tutorial on this but this one tells you the amount of progress your code has made...like say a cleaner..it will actually show you the progress of the cleaner.

alright lets get started.
what you need:

a form
a progress bar
and some code


ok

1st make a form
2nd put a porgress bar on it.

now lets say you have a cleaner. and you have the code
Code:
kill("c:\windows\temp\*.*")
kill("C:\ bla\bla\bla\*.*")
kill("C:\ bla\bla\bla\*.*")
kill("C:\ bla\bla\*.*)
kill("C:\ bla\bla\*.*")
kill("C:\ bla\bla\bla.*")
kill("C:\bla\*.*")
you get the idea :P ( those are not real paths )

now in order to show the progress of all that in the progress bar, you will need to add some stuff to it.

add this in between each file delete

Code:
ProgressBar1.Increment(20) ' the increment can be whatever you like, right now its at 1/5 each time it increments
example:

Code:
kill("c:\windows\temp\*.*")
ProgressBar1.Increment(20)
kill("C:\ bla\bla\bla\*.*")
kill("C:\ bla\bla\bla\*.*")
ProgressBar1.Increment(20)
kill("C:\ bla\bla\*.*)
kill("C:\ bla\bla\*.*")
ProgressBar1.Increment(20)
kill("C:\ bla\bla\bla.*")
kill("C:\bla\*.*")
ProgressBar1.Increment(20)
kill("C:\path\*.*")
kill("C:\path\filename*.*")
ProgressBar1.Increment(20)
then add this at the end of the code
Code:
If ProgressBar1.Value = ProgressBar1.Maximum Then msgbox("done!")
so it should look like this when you are done.

Code:
kill("c:\windows\temp\*.*")
kill("C:\bla\*.*")
ProgressBar1.Increment(20)

kill("C:\ bla\bla\bla\*.*")
kill("C:\ bla\bla\bla\*.*")
ProgressBar1.Increment(20)

kill("C:\ bla\bla\*.*)
kill("C:\ bla\bla\*.*")
ProgressBar1.Increment(20)

kill("C:\ bla\bla\bla.*")
kill("C:\bla\*.*")
ProgressBar1.Increment(20)

kill("C:\path\*.*")
kill("C:\path\filename*.*")
ProgressBar1.Increment(20)

If ProgressBar1.Value = ProgressBar1.Maximum Then msgbox("done!")
Ahhh A cleaner now i understand

Gj man!
Quote Originally Posted by Zoom View Post
Ahhh A cleaner now i understand

Gj man!
yeah, but it doesn't have to be a cleaner. just the easiest example.
Quote Originally Posted by XGelite View Post
yeah, but it doesn't have to be a cleaner. just the easiest example.
I know, good if you dont know how to make a cleaner!
Hmmm this is to hard to understand for the begginers this is for ppl ho know some vb
Quote Originally Posted by Dark_Goliath View Post
Hmmm this is to hard to understand for the begginers this is for ppl ho know some vb
not really..... ;p
Posts 1–6 of 6 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

Need help?