Jump to content

Creating a Clock

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1
AfTriX

AfTriX

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 586 posts
Start of by creating a standard .exe project

now make one label and one timer

name them:
label: lblTime
timer: tmrTimer

now add

Option Explicit

to the code

now we need to use the form_load event to start the clock:
we do this by first adding the code:

Private Sub Form_Load()

End Sub

to the code and now we add the line lblTime.Caption = Time between them to sett the label to the local system time
but we also need to sett the interval of the timer
do this by adding the code:

tmrTimer.Interval = 1000
on the next line (still inside the form_load event)

now we need to ad a update event
add the code:

Private Sub tmrTimer_Timer()

End Sub

outside of the form_load event
now we can add code that will be executed then each time the timer reaches 0

add the code:

lblTime.Caption = Time
inside the tmrTimer_Timer event

now you got a basic digital clock

hope this sums it up
happy coding!!!



Ref:
Photoshop Tutorials and Flash Tutorials

#2
VBnet

VBnet

    Newbie

  • Members
  • PipPip
  • 18 posts
dont forget to add codes in my taco :D