articles

Home / DeveloperSection / Articles / Timer Control in VB.Net

Timer Control in VB.Net

Timer Control in VB.Net

Pushpendra Singh 39631 12-Dec-2010

The Timer Control in VB.Net

Where A Timer control allows you to set a time interval to execute an event after some interval continuously.

This is very useful when you want to execute certain applications after a certain interval.

Drag and drop Timer control from the toolbox on the window Form.

Timer Control in VB.Net

Timer Control in VB.Net

Code:

Public Class Form22
 ' set Interval in Timer
    Private Sub Form22_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ' after 1000 milisecond time will update
        Timer1.Interval = 1000
    End Sub
 
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        'current time will update coontinuesly
        Label1.Text = Now.ToLongTimeString.ToString()
    End Sub
End Class

Run the project 

Timer Control in VB.Net

Time will update continuously after every 1000 millisecond.

Timer Control in VB.Net

Timer properties

Interval:   Gets or sets the interval at which to raise the Elapsed event. 

Enabled:  Gets or sets a value indicating whether the Timer should raise the Elapsed event.  By default, it set to false.


You should also read this Article - Crystal Report with DataSet


Updated 26-May-2020

Leave Comment

Comments

Liked By