phreaky Posted May 26, 2005 Posted May 26, 2005 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 http://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. Quote tHe pHrEaKy
Leaders snarfblam Posted May 26, 2005 Leaders Posted May 26, 2005 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. 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. Quote [sIGPIC]e[/sIGPIC]
phreaky Posted May 26, 2005 Author Posted May 26, 2005 Thanks a lot! Works smoothly Quote tHe pHrEaKy
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.