Results 1 to 4 of 4

Thread: [RESOLVED] TIME - n00b ques

  1. #1

    Thread Starter
    Smitten by reality Harsh Gupta's Avatar
    Join Date
    Feb 2005
    Posts
    2,938

    Resolved [RESOLVED] TIME - n00b ques

    hi all!!
    i just wanted to ask how to display the clock in the project........ i know to use

    VB Code:
    1. Label1.Caption = Time()

    but it will display only the instance of time (the time when i will press F5 or run the code).......i want it to keep ticking like the one in the system tray of my computer.

    plz help....thnx

  2. #2
    PowerPoster kfcSmitty's Avatar
    Join Date
    May 2005
    Posts
    2,248

    Re: TIME - n00b ques

    i'm pretty sure you would have to use a timer to refresh it every second

  3. #3

    Thread Starter
    Smitten by reality Harsh Gupta's Avatar
    Join Date
    Feb 2005
    Posts
    2,938

    Re: TIME - n00b ques

    but sorry i do not know how to refresh any control??? isn't there any in-built (within Time func) to keep it updating automatically??

  4. #4

    Thread Starter
    Smitten by reality Harsh Gupta's Avatar
    Join Date
    Feb 2005
    Posts
    2,938

    Re: TIME - n00b ques

    ok i got it.......use a timer control and set its interval to 500 n use this:

    VB Code:
    1. Private Sub tmrClock_Timer()
    2.      If lblClock.Caption <> Time Then
    3.           lblClock.Caption = Time
    4.      End If
    5. End Sub

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