Progress Bar

Public Class Form2

    Function Factorial(ByVal Value As Double) As Double
        If (Value = 0) Then
            Factorial = 1.0
            System.Threading.Thread.Sleep(3000)
        Else
            Factorial = Value * Factorial(Math.Ceiling(Value - 1))
        End If
    End Function

 
  

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        StatusBar1.Text = "Calculating Factorial(10)"
        Factorial(10)
        ProgressBar1.Value = 50

        StatusBar1.Text = "Calculating Factorial(20)"
        Factorial(20)
        ProgressBar1.Value = 100

        StatusBar1.Text = "Calculating Factorial(30)"
        Factorial(30)
        ProgressBar1.Value = 200
        StatusBar1.Text = "Done"


    End Sub

End Class

 

 

 

TIMER WITH PROGRESS BAR

Public Class Form1
Dim MyProgress As Integer

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ProgressBar1.Style = ProgressBarStyle.Marquee
ProgressBar2.Style = ProgressBarStyle.Continuous
ProgressBar2.Step = 1
Timer1.Enabled = True
End Sub

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
ProgressBar2.Value = MyProgress
If MyProgress < 100 Then MyProgress = MyProgress + 1
Label1.Text = "File Upload = " & MyProgress & "%"
If MyProgress = 100 Then
    Label1.Text = "Complete"
    ProgressBar1.Visible = False
End If

End Sub
End Class

from  http://www.pro2visual.com/link-progress-bar-timer-vb-net.htm