Real time Clock using Visual Basic 6

Language

Step 1: Open MS Visual Basic 6 Step 2: Select Standard EXE as the New Project. Now you have a form named Form1. Step 3: Add a Label to Form1. Now you also have a label named Label1 Step 4: Copy the code below and paste it inside Form1. Step 5: Click Run. Enjoy! :)
  1. Dim WithEvents kell As Timer
  2.  
  3. Private Sub kell_Timer()
  4. Label1.Caption = Format$(Time, "hh:mm:ss AM/PM")
  5. End Sub
  6.  
  7. Private Sub Form_Load()
  8. Set kell = Form1.Controls.Add("vb.timer", "kell", Form1)
  9. With kell: .Interval = 200: .Enabled = True: End With
  10. End Sub

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.

Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.

FOR YOUR OWN SAFETY, PLEASE:

1. Re-scan downloaded files using your personal virus checker before using it.
2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

Comments

Submitted byvhal (not verified)on Tue, 03/14/2017 - 00:26

something happens when i time in then it will time in and out in am and pm . what should i going code for that error? can u pls help me.

Add new comment