VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



A Progress Bar with timer

by Mohammad Akram (4 Submissions)
Category: Miscellaneous
Compatability: VB.NET
Difficulty: Unknown Difficulty
Originally Published: Tue 27th March 2007
Date Added: Mon 8th February 2021
Rating: (1 Votes)

A Progress Bar with timer

Rate A Progress Bar with timer




    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        'Task: Timer Progress Bar. It Display How Many Seconds Left .....

        'Declarations


        'Code:
        Dim LThen As Integer = 0
        ProgressBar1.Value = 0
        ProgressBar1.Maximum = 20

        Do While ProgressBar1.Value < ProgressBar1.Maximum
            ProgressBar1.Value += 1
            LThen = DateAndTime.Timer()
            Dim s
            Do While DateAndTime.Timer() < (LThen + 1)
                Me.Text = (ProgressBar1.Maximum - ProgressBar1.Value) & " Second(s)Left"
            Loop
        Loop

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim LThen As Integer = 0
        ProgressBar1.Value = 0
        ProgressBar1.Maximum = 20

        Do While ProgressBar1.Value < ProgressBar1.Maximum
            ProgressBar1.Value += 1
            LThen = DateAndTime.Timer()
            Dim s
            Do While DateAndTime.Timer() < (LThen + 1)
                Me.Text = (ProgressBar1.Maximum - ProgressBar1.Value) & " Second(s)Left"
            Loop
        Loop
        End
    End Sub
End Class


Download this snippet    Add to My Saved Code

A Progress Bar with timer Comments

No comments have been posted about A Progress Bar with timer. Why not be the first to post a comment about A Progress Bar with timer.

Post your comment

Subject:
Message:
0/1000 characters