system clock

How can I add a system clock (tick) on my form? I want to put it where the caption is.
VBdotnet2005Asked:
Who is Participating?
 
PaulHewsConnect With a Mentor Commented:
Like this?  Add a timer component to your form:  


Public Class Form1
 
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Timer1.Enabled = True
        Timer1.Interval = 100
 
    End Sub
 
   
 
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Me.Text = Now.ToString
 
    End Sub
End Class

Open in new window

0
All Courses

From novice to tech pro — start learning today.