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
Clock in switchboard
Collapse
X
-
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
in the TimerIntervalCode:me.label1.caption = Time() me.refresh
1000
Make sure in the OnClose event of your form stops the timer.
BenderCode:me.timerinterval = 0
-
This sets the TimerInterval and immediately populates the textbox until the timer function cranks up:
This populates the textbox every second:Code:Private Sub Form_Load() Me.TimerInterval = 1000 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!Code:Private Sub Form_Timer() Me.txtDateTime = Now End Sub
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
Comment