• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 425
  • Last Modified:

I need to run an event every 3 seconds with the Timer control in winform. net

I need to run an event every 3 seconds with the Timer control in winform. net?
anyone have any idea
I am using the timer control in visual studio 2008
0
infogws
Asked:
infogws
1 Solution
 
teedo757Commented:
Try a look with a sleep function

System.Threading.Thread.Sleep(300)

Add a check variable to break the loop when needed.
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
Set the Interval() property to 3000 for three seconds.
Set Enabled() property to True so it fires.
Double Click the Timer control to get the Tick() event.

Put your code in there:  
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
    ' ... some code in here ...
End Sub

Open in new window


What do you need to happen every three seconds?
0
 
infogwsAuthor Commented:
:)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now