A progress bar that goes along as it does loops

Do you need something made? then ask in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
8 posts Page 1 of 1
Contributors
User avatar
noobcake
Member
Member
Posts: 34
Joined: Sun Mar 27, 2011 12:16 am

I have made a program that spams right, And I want it to have a progress bar so you can tell how much you have spammed out of the total you wanted to spam,So you have a general idea of whats happening. Other wise I sit there like hmmmm is it working? lol. Thanks guys :)


Ps. Am i doing something wrong by asking for all theese tuts? I don't know if its considered spam maby?. Or im considered a leacher or something, been on here 2days and have asked for like 3 different things, lol.

Thanks in advance,

~Noobcake
If i Help you +Rep cooll;

Im new to visual basic so I probly wont :P
User avatar
Axel
Coding God
Coding God
Posts: 1928
Joined: Sun Jun 27, 2010 9:15 pm

noobcake wrote:
I have made a program that spams right, And I want it to have a progress bar so you can tell how much you have spammed out of the total you wanted to spam,So you have a general idea of whats happening. Other wise I sit there like hmmmm is it working? lol. Thanks guys :)


Ps. Am i doing something wrong by asking for all theese tuts? I don't know if its considered spam maby?. Or im considered a leacher or something, been on here 2days and have asked for like 3 different things, lol.

Thanks in advance,

~Noobcake
Progressbar.Maxvalue = Totalspams
for i = 0 To Totalspams as integer
'your codeuo gseo heroi
Progressbar.Value +=1 'the progressbar value goes +1 when the previous action is complete
next

That should be right I guess
http://vagex.com/?ref=25000
User avatar
bisnes_niko
Serious Programmer
Serious Programmer
Posts: 409
Joined: Tue Aug 24, 2010 1:21 pm

Here are some values, add them under Public Class FormName

dim intCurrentSpam as integer = 0, intWantedSpams as Integer = 0
Code: Select all
' on load or set through progressbar properties
progressbar1.maximum = 100 ' for percentages
I assume you use a timer to spam the wanted text, so add this code onto it:
Code: Select all

' SPAM SPAM SPAM

' // Raises the current spam value
intCurrentSpam += 1

progressbar1.value = intCurrentSpam / intWantedSpams * 100

if intCurrentSpam >= intWantedSpams Then
timer1.stop() 
' Spammed as many times as wanted...
End if

This should help you out somehow
User avatar
Axel
Coding God
Coding God
Posts: 1928
Joined: Sun Jun 27, 2010 9:15 pm

macHard wrote:
Here are some values, add them under Public Class FormName

dim intCurrentSpam as integer = 0, intWantedSpams as Integer = 0
Code: Select all
' on load or set through progressbar properties
progressbar1.maximum = 100 ' for percentages
I assume you use a timer to spam the wanted text, so add this code onto it:
Code: Select all

' SPAM SPAM SPAM

' // Raises the current spam value
intCurrentSpam += 1

progressbar1.value = intCurrentSpam / intWantedSpams * 100

if intCurrentSpam >= intWantedSpams Then
timer1.stop() 
' Spammed as many times as wanted...
End if

This should help you out somehow
He said it were loops lol
and its much easyer if you set your progressbar maximum to the amount of spams
http://vagex.com/?ref=25000
User avatar
MrAksel
C# Coder
C# Coder
Posts: 1758
Joined: Fri Mar 26, 2010 12:27 pm

Axel wrote:
He said it were loops lol
and its much easyer if you set your progressbar maximum to the amount of spams
That would be more efficient too, because dividing operations takes much time to execute, so the more dividing you have, the slower is your program
LMAOSHMSFOAIDMT
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;


Over 30 projects with source code!
Please give reputation to helpful members!

Image
Image
User avatar
Axel
Coding God
Coding God
Posts: 1928
Joined: Sun Jun 27, 2010 9:15 pm

MrAksel wrote:
Axel wrote:
He said it were loops lol
and its much easyer if you set your progressbar maximum to the amount of spams
That would be more efficient too, because dividing operations takes much time to execute, so the more dividing you have, the slower is your program
Well on a decent processor that would take about no time
but without dividing it only takes like 3 lines and changing some properties lol
you can also use backgroundworker but for such a small example it would be less efficient
http://vagex.com/?ref=25000
User avatar
noobcake
Member
Member
Posts: 34
Joined: Sun Mar 27, 2011 12:16 am

Hmmm, I have tried to add this code and confused myself lol. what I currently do is...
Code: Select all
Do Untill spam = 0
     'spam stuff here

     spam += -1
Loop
How would I work a progress bar into there? Should I make a new thing for the number of spams i want to do?
Because spam = the number I enter in to spam, but it gets 1 taken away from it every loop, so saying currentspam/spam, fails because spam is always changing? does anyone understand that lol?

Also, i have a problem. at the start of my program I have,
On Error GoTo error_handler

and then near the end...
Code: Select all
error_handler
MsgBox("You F**Ked it idiot =.=")
Exit Sub
but when ever my script finishes, after I click out of the message box saying, spam finished, that error message comes up also D:. is there something i am missing before the Error_handler thing?
If i Help you +Rep cooll;

Im new to visual basic so I probly wont :P
User avatar
MrAksel
C# Coder
C# Coder
Posts: 1758
Joined: Fri Mar 26, 2010 12:27 pm

If you want to exit before the error_handler you have to put 'Exit Sub' te exit before the message comes, to increase the progressbar value use 'ProgressBar1.Value += 1'
LMAOSHMSFOAIDMT
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;


Over 30 projects with source code!
Please give reputation to helpful members!

Image
Image
8 posts Page 1 of 1
Return to “Tutorial Requests”