How to use timer???

phreaky

Regular
Joined
Dec 7, 2002
Messages
71
Location
Caracas, Venezuela
I'm orking on a simulation project, and I need to fill a Listox using a timer to do it, I'm simulating a phone central with 25 lines and many users, and I need to simulate users making a 'lane' to get access to telephone line and dial. For this, I need to put them in 'lane' (my lane will be the Listbox) every certain time, but I need to use the timer and I don't know how. I have consulted www.msdn.com, but it has an example for use the timer in console and NOT in Windows Form (and I'm not so expert with Visual Basic .NET), so I need an example of encolating people in my listbox using the timer.
 
Just add a timer component to your form. Set the interval property (in milliseconds) and either set the enabled property (in the property grid) to true, or call the .Start method (in code). Double click the timer in the designer and it will pop up the code with a handler template for the Tick event.
Visual Basic:
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
 
    End Sub
Just put the code that should be executed every-so-often inside that sub.
 
Back
Top