Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

[TUT] How to use progress bars in depth [Noob Proof]

(May 12, 2011 03:55 PM)Alex™ Wrote:  2) Double click 'Button1', then write
PHP Code

<?php 
ProgressBar1
.Value = ProgressBar1.Value + 10 
Spoiler (Click to View)

You should use the .Increment method instead, it's shorter and it's what it was make for.
Thank you,. I needed this!!
You should make a timer which automatically increments.
(May 12, 2011 03:58 PM)Alex™ Wrote:  Thanks, here is the new code, ill put it in the post in a sec.
PHP Code

<?php 
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
  
If ProgressBar1.Value = 100 Then
    Timer1
.Stop()
    
MessageBox.Show("Done!")
    
'or add what you need done after the progressbar has reached 100%
  Else
    ProgressBar1.Increment(+10)
  End If

    End Sub 

You don't need the "+," just 10.

(May 12, 2011 04:09 PM)Alex™ Wrote:  i don't O.o ok lol thanks

What do you mean you don't?

Quote: ProgressBar1.Increment(+10)

(May 12, 2011 04:13 PM)Alex™ Wrote:  like an a rhetorical question i.e bob says"you need to do 'x' " sid says" I do? ok"

Oh, well, there was no question mark, lol, I thought you meant it literally.
I made a really good progress par tutorial but I reformatted my pc :(
(May 12, 2011 04:21 PM)Alex™ Wrote:  Do people have BB code editors or something? how do people make these really long threads, this one must of took an hour with all the pics n shit.

This just gave me a cool idea for a VB project, thanks.
Thanks a bunch, noob proof lol
I lol'd at the thread title when you said noob proof but when I saw the thread I was like HOLY SHIT ROFL THIS IS SO INDEPTH.
I was really expecting something in depth with some more advanced coding but this is basic progress bars.
Fair play this is helpful to beginners, the reason behind saying that isn't just the snippet for adding a progress bar but with visual support to the annotations (like debugging) helps newbies understand what people mean in other written tutorials.

P.S my name's alex also and Im proud as hell to be british :)

--

(May 12, 2011 05:02 PM)Alex™ Wrote:  Thanks for that but im pretty new to vb.net could you please tell me how i would use that?

Basically by using
progressbar1.value = progressbar1.value +1
this is saying the new value will be the current value of progress bar 1 PLUS another one.
however this code: progressbar1.value += 1
does exactly the same thing just shorter and cleaner.

Code
dim i as integer = 0 'declaring i as an integer, an integer holds a number giving it the value of 0
i += 1 ' the value of i now becomes the current value so 0 + 1 the next time you execute this i will = 2 because you just +1 and therefore the next output will be 3
(May 12, 2011 05:43 PM)Alex™ Wrote:  VERY well explaind thanks, ill add that into the tut tomorrow, im going to bed pretty soon and im on my ipad right now so its hard to c&p

No Worries Bro ✌
It's a decent tutorial but I wouldn't call this in-depth at all.
Also, I have to agree with Mr. Predictable:
Using timer in an environment where this is not needed may cause buggy or slow applications.
Maybe you should consider following a few tutorials yourself.
(May 12, 2011 03:57 PM)Tim Joe Wrote:  Thank you,. I needed this!!

I think I was high when I said this LMAO I don't even remember it! But nice tut, I didn't need this but someone else most likely does


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Python] by MiguelSanchezFeb 20, 2022 07:49 AM 2 128 Feb 20, 2022 07:49 AM
Last Post: Sky
[.NET] by blake.haleApr 8, 2018 10:31 AM 8 639 Apr 8, 2018 10:31 AM
Last Post: adenfr
[.NET] by blake.haleApr 7, 2018 03:45 PM 16 1,327 Apr 7, 2018 03:45 PM
Last Post: darkvas