Results 1 to 7 of 7

Thread: Time Ticker - howto?

  1. #1

    Thread Starter
    Hyperactive Member Trojan's Avatar
    Join Date
    Dec 2003
    Location
    Area 51
    Posts
    280

    Resolved Time Ticker - howto?

    how can I make a time counter?
    Last edited by Trojan; Dec 26th, 2004 at 02:20 PM. Reason: Resolved!
    MD5How To Detect Disk In Drive X?Time Tickerchanging the owner of a controlSystray HardCore

    • "Programming is like sex: one mistake and you have to support it for the rest of your life."
    • "A program is a spell cast over a computer, turning input into error messages."
    • "WARNING: Keyboard Not Attached. Press F10 to Continue."
    • "Why doesn't DOS ever say 'EXCELLENT command or filename!'"

  2. #2
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Time Ticker - howto?

    You'd have to be much more descriptive than that - what time you need to count, interval (seconds, minutes, hours, days ...) ...

  3. #3

  4. #4

    Thread Starter
    Hyperactive Member Trojan's Avatar
    Join Date
    Dec 2003
    Location
    Area 51
    Posts
    280

    Re: Time Ticker - howto?

    No that's a diffrent project...

    I am building an app to connect to MySQL Server and I wan't to put in the status bar a clock counter to count how much time the user is connected to the remote databse...

    p.s.
    The format of the clock is like this: 00:00:00
    MD5How To Detect Disk In Drive X?Time Tickerchanging the owner of a controlSystray HardCore

    • "Programming is like sex: one mistake and you have to support it for the rest of your life."
    • "A program is a spell cast over a computer, turning input into error messages."
    • "WARNING: Keyboard Not Attached. Press F10 to Continue."
    • "Why doesn't DOS ever say 'EXCELLENT command or filename!'"

  5. #5
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Time Ticker - howto?

    Put a timer control on your form and copy/paste this sample:
    VB Code:
    1. Private Sub Form_Load()
    2.     Timer1.Interval = 1000
    3.     Timer1.Enabled = True
    4.     Label1.AutoSize = True
    5.     Label1.Caption = "Elapsed time since login: 00:00:00"
    6. End Sub
    7.  
    8. Private Sub Timer1_Timer()
    9. Static lSeconds&
    10. Dim sTime$
    11.  
    12.     lSeconds = lSeconds + 1
    13.     sTime = Str$(lSeconds \ 3600) & ":" & _
    14.             Str$(lSeconds \ 60) & ":" & _
    15.             Str$(lSeconds Mod 60)
    16.     Label1.Caption = "Elapsed time since login: " & Format(CDate(sTime), "hh:nn:ss")
    17.  
    18. End Sub

  6. #6

    Thread Starter
    Hyperactive Member Trojan's Avatar
    Join Date
    Dec 2003
    Location
    Area 51
    Posts
    280

    Re: Time Ticker - Resolved!

    Thanks RhinoBull!
    MD5How To Detect Disk In Drive X?Time Tickerchanging the owner of a controlSystray HardCore

    • "Programming is like sex: one mistake and you have to support it for the rest of your life."
    • "A program is a spell cast over a computer, turning input into error messages."
    • "WARNING: Keyboard Not Attached. Press F10 to Continue."
    • "Why doesn't DOS ever say 'EXCELLENT command or filename!'"

  7. #7
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Time Ticker - howto?

    Not at all. Any time.

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