How do I show the time and date on a label.
Brian K. Sheperd - 30 Dec 2003 15:29 GMT
Is this what you are looking for?
Private Sub Form_Load()
Label1.Caption = Now()
End Sub
When the form is loaded, it will put the current time and date in a label.
Brian
> How do I show the time and date on a label.
Brian K. Sheperd - 30 Dec 2003 15:39 GMT
Or... If you want it to update at an interval, you can add the timer
control. Timer interval is in miliseconds.
Private Sub Form_Load()
Timer1.Interval = 1000
Label1.Caption = Now()
End Sub
Private Sub Timer1_Timer()
Label1.Caption = Now()
End Sub
Brian
> How do I show the time and date on a label.
Ben Ben - 31 Dec 2003 08:13 GMT
Use the timer ActiveX on the left bar. Pull that icon on your developed
interface. Draw a label name Label1. and input the source code as follows
Private Sub Timer1_Timer()
Label1.Caption = Time ' Update time display.
End Sub
> How do I show the time and date on a label.