ARTICLE

Timer and Progress Bar in VB.NET

Posted by Sumit Pathak Articles | VB.NET Tutorials January 03, 2011
In this article you will learn how to use Timer and Progress Bar in VB.NET.
Download Files:
 
Reader Level:

Public Class TimeProgressbardemo
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Me.ProgressBar1.Value = 99
        If ProgressBar1.Value >= 100 Then
            ProgressBar1.Value = 0
        End If
        Return
    End
Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Timer1.Enabled = True
        Me.ProgressBar1.Step = 10
        Me.ProgressBar1.Maximum = 100
        Me.ProgressBar1.Minimum = 0
        Me.ProgressBar1.Style = ProgressBarStyle.Continuous
    End Sub
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        If Me.ProgressBar1.Value <> 0 Then
            Me.Timer1.Enabled = False
            Me.ProgressBar1.Value = 0
        Else
            MsgBox("Value is already reach to zero")
            Return
        End If
    End
Sub
End Class

Below is Diagram or figure 1.1 and project Timer and Progress bar Demo.

vb.gif

Login to add your contents and source code to this article
share this article :
post comment
 
Nevron Diagram
Become a Sponsor
PREMIUM SPONSORS
  • Get 2 Months Free of ASP.NET Hosting for Only $4.95/month! Receive FREE MS SQL and MySQL Databases Including ASP.NET 4/3.5, MVC 3.0, Silverlight 4, Windows 2008/IIS 7.0 Plus FREE IIS 7 Modules. Host UNLIMITED ASP.NET Web Sites - Click Here!
    Get 2 Months Free of ASP.NET Hosting for Only $4.95/month! Receive FREE MS SQL and MySQL Databases Including ASP.NET 4/3.5, MVC 3.0, Silverlight 4, Windows 2008/IIS 7.0 Plus FREE IIS 7 Modules. Host UNLIMITED ASP.NET Web Sites - Click Here!
6 Months Free & No Setup Fees ASP.NET Hosting!
Become a Sponsor