Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Simple loading bar
#1
Code:
Dim i As Integer

Private Sub Form_Load()
     i = 0
     Timer1.Enabled = True
     Timer1.Interval = 20
End Sub

Private Sub Timer1_Timer()
     ProgressBar1.Value = i / 50 * 100
     i = i + 1
     If i > 50 Then
        Timer1.Enabled = False
    Unload Me
Form1.Show
     End If
End Sub

Taken from:

http://www.vbforums.com/showthread.php?t=421073

All credits go to their creators.


Does anyone else have a better code?

I would like to use it.
Reply
#2
(11-18-2010, 11:09 AM)Extremespeed™ Wrote:
Code:
Dim i As Integer

Private Sub Form_Load()
     i = 0
     Timer1.Enabled = True
     Timer1.Interval = 20
End Sub

Private Sub Timer1_Timer()
     ProgressBar1.Value = i / 50 * 100
     i = i + 1
     If i > 50 Then
        Timer1.Enabled = False
    Unload Me
Form1.Show
     End If
End Sub

Taken from:

http://www.vbforums.com/showthread.php?t=421073

All credits go to their creators.


Does anyone else have a better code?

I would like to use it.

All you need is a timer. And in the Timer you go progressbar1.increment(1)

And the increment(?) is by how much it goes up and how fast it goes..

Then all you have to do is enable the timer when you want the progress bar to go.
"Death smiles at us all. All a man can do is smile back".
[Image: siggy.png]
MSN: Xzotic@live.com
Reply
#3
(11-18-2010, 02:38 PM)Xzotic Wrote: All you need is a timer. And in the Timer you go progressbar1.increment(1)

And the increment(?) is by how much it goes up and how fast it goes..

Then all you have to do is enable the timer when you want the progress bar to go.


What he means is, all your code is doing is...

ProgressBar1.Increment(2)

it looks like you took that code out of a splash screen.

do like Xzotic said...

Code:
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        ProgressBar1.Increment(2)
End Sub

then set the interval from the properties window.
so that you don't get errors, add this bit in.

Code:
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        If Not ProgressBar1.Value = ProgressBar1.Maximum Then
            ProgressBar1.Increment(2)
        Else
            Timer1.Enabled = False
        End If
End Sub
Reply
#4
Nice tut even though it was from Hackforums.net / But this will help out others that doesn't understand anything from youtube.
Reply
#5
(11-19-2010, 12:35 AM)JesusFromHF Wrote: Nice tut even though it was from Hackforums.net / But this will help out others that doesn't understand anything from youtube.

I dont mean to be rude, but what are you trying to say?

He credited his source:
(11-18-2010, 11:09 AM)Extremespeed™ Wrote: Taken from:

http://www.vbforums.com/showthread.php?t=421073

All credits go to their creators.
Reply
#6
Pretty simple, but still nice for people to learn from.
Reply
#7
Nice tutorial, and great share. I've also seen this on HF.
Reply
#8
very good sources /tutorial , thanks for sharing...
Reply
#9
Needs some improvements, but otherwise it's looking good.
bob
Reply
#10
Thank you very much for this share, I appreciate it.

Now I understand this.
"I'm not slacking off... my code it compiling"
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [VB.Net] Progress bar in the icon in the taskbar [Win7] The-One 10 6,085 06-19-2011, 03:08 PM
Last Post: The-One
  [Source]Progress BAR Personnalized-[Make Your Tools Prettier]! ThePrinCe 2 1,110 02-17-2011, 10:02 AM
Last Post: ThePrinCe
  [SIMPLE] Loading Screen VB [TUTORIAL] Zerb 12 5,265 12-13-2010, 09:43 PM
Last Post: Zerb
  [C#] Loading/Writing XML Files [Intermediate] Mike 4 2,281 09-29-2010, 10:17 AM
Last Post: Fitz-

Forum Jump:


Users browsing this thread: 4 Guest(s)