Print of Current Time continuously

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Stroumfs
    New Member
    • Mar 2007
    • 28

    Print of Current Time continuously

    Hello Guys!!!


    My form has a label which i print the current time.
    I want to make a counter which will give me the time each minute.

    So, whatever i see on my computer the same think to see and in my label.

    I used the following command for printing the time
    lblTime.Text = TimeString()

    I use VB2005.

    Can anyone help with some vbcode because i am desperate...?
  • Stroumfs
    New Member
    • Mar 2007
    • 28

    #2
    Originally posted by Stroumfs
    Hello Guys!!!


    My form has a label which i print the current time.
    I want to make a counter which will give me the time each minute.

    So, whatever i see on my computer the same think to see and in my label.

    I used the following command for printing the time
    lblTime.Text = TimeString()

    I use VB2005.

    Can anyone help with some vbcode because i am desperate...?

    I found the solution is
    Public Class Form1

    Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As System.EventArg s) Handles MyBase.Load

    lblTime.Text = Format(Now, "hh.mm.ss tt")

    End Sub

    Private Sub Timer1_Tick(ByV al sender As System.Object, ByVal e As System.EventArg s) Handles Timer1.Tick

    lblTime.Text = Format(Now, "hh.mm.ss tt")

    End Sub

    End Class

    time interval 100

    thnx
    anyway


    We can close this case
    Last edited by Killer42; May 22 '07, 10:55 AM. Reason: Add [/QUOTE] tag

    Comment

    • Killer42
      Recognized Expert Expert
      • Oct 2006
      • 8429

      #3
      I would recommend setting the timer interval a fair bit longer. This will fire ten times a second, which seems like a lot of unnecessary work.

      Although if the "tt" in your format represents tenths of a second, then perhaps you do want it to update that frequently?

      Comment

      Working...