CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Timer

  1. #1
    Join Date
    Aug 2000
    Location
    Germany
    Posts
    50

    Timer

    How does the timer works? Can you give me an example?

    Tanks!


  2. #2
    Join Date
    Jan 2000
    Location
    Olen, Belgium
    Posts
    2,477

    Re: Timer

    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
    [email protected]

    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
    Tom Cannaerts
    email: [email protected]
    www.tom.be (dutch site)

  3. #3
    Join Date
    Apr 2000
    Location
    South Carolina,USA
    Posts
    2,210

    Re: Timer

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured