Click to See Complete Forum and Search --> : Timer


DavidTeichert
September 6th, 2001, 08:25 AM
How does the timer works? Can you give me an example?

Tanks!

Cakkie
September 6th, 2001, 08:31 AM
If you mean the control:
Set its interval property, this is the delay in milliseconds. Then double click it, you will come in the Timer Event of the control. There you can add the code you want to execute

' this adds X to the caption of the label, of course, you might come up with a better idea then just adding X to a label...
private Sub Timer1_Timer()
Label1.Caption = Label1.Caption & "X"
End Sub




If you mean the Timer function

The timer functions gives the number of seconds since the OS was booted

msgbox "Windows has been running for " & Timer & " seconds"





Tom Cannaerts
slisse@planetinternet.be

Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook

John G Duffy
September 6th, 2001, 08:38 AM
The TImer FUnction is documented in the MSDN HELP facility. BAsically it returns the number of seconds elapssed since midnight. There is a Example of usage there.
There also is a Timer Control documented there which is much like any other control in that it has a programmable event which fires at specified intervals.

John G