Welcome to Dream.In.Code
Become a VB Expert!

Join 137,228 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,926 people online right now. Registration is fast and FREE... Join Now!




Timer

 
Reply to this topicStart new topic

Timer, using a timer

orangeslide8
25 Feb, 2007 - 01:24 PM
Post #1

D.I.C Head
Group Icon

Joined: 29 Dec, 2006
Posts: 190



Thanked: 1 times
Dream Kudos: 25
My Contributions
i would like something to happen every 5 seconds so could i put a timer on and say
CODE

Private sub Timer1_Tick(ByVal sender as system.Object, Byval e as system.EventArgs) Handles Timer1.Tick
timer1.Interbal = 5000
' then i want to say basicly every tick do something Does anyone know how to do it?
end sub

thnx
john
User is offlineProfile CardPM
+Quote Post

Jayman
RE: Timer
25 Feb, 2007 - 01:33 PM
Post #2

Student of Life
Group Icon

Joined: 26 Dec, 2005
Posts: 6,984



Thanked: 44 times
Dream Kudos: 500
Expert In: C#, VB.NET, Java

My Contributions
First of all, you need to declare the Timer Interval before you ever start the timer. Not inside the Tick event of the timer.

When you are ready to Start the timer, you just use the start method. myTimer.Start(), inversly myTimer.Stop() will stop your timer.

Secondly, you put any code inside the Tick event of the timer that you want to execute when the amount of time has passed that the timer is set for.
User is online!Profile CardPM
+Quote Post

orangeslide8
RE: Timer
25 Feb, 2007 - 01:36 PM
Post #3

D.I.C Head
Group Icon

Joined: 29 Dec, 2006
Posts: 190



Thanked: 1 times
Dream Kudos: 25
My Contributions
QUOTE(jayman9 @ 25 Feb, 2007 - 02:33 PM) *

First of all, you need to declare the Timer Interval before you ever start the timer. Not inside the Tick event of the timer.

When you are ready to Start the timer, you just use the start method. myTimer.Start(), inversly myTimer.Stop() will stop your timer.

Secondly, you put any code inside the Tick event of the timer that you want to execute when the amount of time has passed that the timer is set for.

thnx it worked
john
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/4/08 02:53PM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month