Public Class Form1

    Private t As Integer

    Private Sub ProgressBar1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ProgressBar1.Click

 

    End Sub

    Private Sub LoopMethod()

        Dim ctr As Integer

        For ctr = 1 To 1000000

            ctr += 1

            ProgressBar1.PerformStep()

            Label2.Text = ProgressBar1.Value.ToString / 100 & "%"

        Next

    End Sub

 

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        ProgressBar1.Maximum = 10000

        ProgressBar1.Minimum = 1

        ProgressBar1.Step = 100

    End Sub

 

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Me.Close()

    End Sub

 

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

        LoopMethod()

    End Sub

End Class