jvcoach23 Posted July 9, 2003 Posted July 9, 2003 I've search through the archives but just don't know enough to be able to use any of the code I've found. What I'm trying to do it create a loop that will run every 30 seconds and fire off a private sub, the private sub is filling 3 datagrids with sql info. I've tried to work with the timer but have had any success. Can someone show me how you can set the timer to call a private sub every 30 seconds. Is the app locked while that timer is running, I'd like to be able to use a mannual refresh button as well. thanks shannon Quote JvCoach23 VB.Net newbie MS Sql Vet
*Experts* mutant Posted July 9, 2003 *Experts* Posted July 9, 2003 Heres an example: (first drag the timer from the toolbox onto the form) Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Timer1.Enabled = True 'enable the timer Timer1.Interval = 30000 'set the interval to 30000 milliseconds 'which equals 30 seconds Timer1.Start() 'start the timer End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick SomeSub() 'use the Tick event to call the sub, Tick is raised 'when the timer reached the interval End Sub Private Sub SomeSub() MessageBox.Show("Hi") 'do whatever you want here End Sub Quote
jvcoach23 Posted July 9, 2003 Author Posted July 9, 2003 cool, thanks, I'll try it Quote JvCoach23 VB.Net newbie MS Sql Vet
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.