Clock in switchboard

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cabetron5
    New Member
    • Mar 2008
    • 1

    #1

    Clock in switchboard

    i have implemented a switchboard for navigation and inserted the date & time function, i wish to veiw the seconds changing on the screen, don't know how to set this feature, Thanks A
  • MindBender77
    New Member
    • Jul 2007
    • 233

    #2
    Are you asking if you can put a, for lack of better description, clock on your form? If so, create a label on your form and type clock in it. Then set your forms's OnTimer event to
    Code:
    me.label1.caption = Time()
    me.refresh
    in the TimerInterval
    1000

    Make sure in the OnClose event of your form stops the timer.
    Code:
    me.timerinterval = 0
    Bender

    Comment

    • missinglinq
      Recognized Expert Specialist
      • Nov 2006
      • 3533

      #3
      This sets the TimerInterval and immediately populates the textbox until the timer function cranks up:
      Code:
      Private Sub Form_Load()
       Me.TimerInterval = 1000
       Me.txtDateTime = Now
      End Sub
      This populates the textbox every second:
      Code:
      Private Sub Form_Timer()
       Me.txtDateTime = Now
      End Sub
      You can lock the textbox if you like, but anyone messing with it will find that the correct date/time reappears every second anyway!

      And the TimerInterval does not have to be set to zero on closing the form! It stops automatically when the form closes.

      Welcome to TheScripts!

      Linq ;0)>

      Comment

      Working...