Larry Cutliffe
asked on
VB Timer
This should be pretty simple but for some reason Im not graspin how to utilize the timer code in VB 2005. I'm workin on practice excersises as I'm learning how to write this stuff and one of the projects I am working on is just making a simple window with a box showing the date and time. I have been instructed to insert a timer to update the clock every second but I'm not sure of the code to make the timer do exactly that. It is in the form but I need to get some help on what to write and where to put it to make the time update. *Note* - On the form I already have the timer enabled with an interval of 1000.
This is what I got so far.
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim Time1 As Date
Time1 = Now
lbl2.Text = Time1
lbl2.Text = Format(Time1, "h:mm:ss")
End Sub
End Class
Its pretty simple but for some reason i cant find the answer i'm lookin for.
LC
This is what I got so far.
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim Time1 As Date
Time1 = Now
lbl2.Text = Time1
lbl2.Text = Format(Time1, "h:mm:ss")
End Sub
End Class
Its pretty simple but for some reason i cant find the answer i'm lookin for.
LC
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
And don't forget to set the Interval = 1000 (1000 = 1 second)
ASKER
Thank you sir, you freed me from my sticking point.
LC
LC