VB.Net Timer Control

VB.NET - How To Use Timer Control In Visual Basic.Net

                                                                                                                         

In This VB.NET Tutorial We Will See How To Add And Use Timer Tick, Start, Stop, Interval In Visual Basic .NET Programming Language.


Project Source Code:

Public Class VBNET_Using_Timer_Control

    Dim MyInterVal As Integer = 50

    Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick

        If lblM.ForeColor = Color.Green Then

            lblM.ForeColor = Color.Red

        ElseIf lblM.ForeColor = Color.Red Then

            lblM.ForeColor = Color.Green

        End If

        Timer1.Interval = MyInterVal
        MyInterVal = MyInterVal + 50
        Label1.Text = MyInterVal.ToString()

    End Sub

    Private Sub VBNET_Using_Timer_Control_Load(sender As Object, e As EventArgs) Handles MyBase.Load

        Timer1.Start()

    End Sub

    Private Sub BTN_STOP_Click(sender As Object, e As EventArgs) Handles BTN_STOP.Click

        Timer1.Stop()

    End Sub

    Private Sub BTN_START_Click(sender As Object, e As EventArgs) Handles BTN_START.Click

        Timer1.Start()

    End Sub
End Class

///////////////OUTPUT:

vb.net using timer control







Share this

Related Posts

Previous
Next Post »