Support Forums
Simple loading bar - Printable Version

+- Support Forums (https://www.supportforums.net)
+-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87)
+--- Forum: Coding Support Forums (https://www.supportforums.net/forumdisplay.php?fid=18)
+---- Forum: Visual Basic and the .NET Framework (https://www.supportforums.net/forumdisplay.php?fid=19)
+---- Thread: Simple loading bar (/showthread.php?tid=13842)



Simple loading bar - Extremespeed™ - 11-18-2010

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.


RE: Simple loading bar - Xzotic - 11-18-2010

(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.


RE: Simple loading bar - KoBE - 11-18-2010

(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



RE: Simple loading bar - Christopher - 11-19-2010

Nice tut even though it was from Hackforums.net / But this will help out others that doesn't understand anything from youtube.


RE: Simple loading bar - KoBE - 11-19-2010

(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.



RE: Simple loading bar - versx - 11-30-2010

Pretty simple, but still nice for people to learn from.


RE: Simple loading bar - Chimi - 12-06-2010

Nice tutorial, and great share. I've also seen this on HF.


RE: Simple loading bar - NathanE - 12-12-2010

very good sources /tutorial , thanks for sharing...


RE: Simple loading bar - Blacklite - 12-12-2010

Needs some improvements, but otherwise it's looking good.


RE: Simple loading bar - Figaro - 12-12-2010

Thank you very much for this share, I appreciate it.

Now I understand this.