tags:

views:

32

answers:

4

I am trying to use an timer control in my console application Friend WithEvents XTIMER As System.Windows.Forms.Timer I am getting its all the properties.I have set the interval to 15000 ms.but even if i am setting the enabled state of the timer control to be true,the tick event is not firing.Can any one help me out please!!!!! Thanks in advance

A: 

Use System.Timers.Timer instead. Here's a very good comparison of the timer classes.

Tom Juergens
A: 

Use the Timer Class

M.H
@@ To ALL,All these works fine in Desktop application but it is not working in onsole Application.The tick event is not firing
Rajdeep
@M.H Thanks...This articled helped me.Appreciate your help
Rajdeep
very nice to hear that..
M.H
A: 

Import the System.Windows.Forms reference and use the Timer class.

Alex Essilfie
A: 
Module Module1

    Sub Main()
        aTimer.AutoReset = True
        aTimer.Interval = 2000 '2 seconds
        AddHandler aTimer.Elapsed, AddressOf tick
        aTimer.Start()
        Console.ReadKey()
    End Sub

    Dim aTimer As New System.Timers.Timer

    Private Sub tick(ByVal sender As Object, ByVal e As System.Timers.ElapsedEventArgs)
        Console.WriteLine("tick")
    End Sub

End Module
dbasnett