Hi Pals could anyone show me how to code an active clock window
Thanks in advance

fourty

Recommended Answers

All 7 Replies

if you mean: to show the current time of computer then please try this

text1.text = now ' show time & date
Text1.Text = Format(date, "dd/mm/yyyy") ' show date

Thanks Abu im going to try it but what i meant exactly is an active clock with the seconds tickin in real time..Let me try this first.
Thanks.


fourty

Do the following.
1. Add a Timer on the Form
2. Set the Timer Enable, Interval = 1000
3. Add this code

Private Sub Timer1_Timer()
Me.Caption = Format(Now, "s")
End Sub

This code will show you the current time seconds in the form caption or you might want to research on the GetTickCount API function.

Jhai, his looking for something similar to a analog wrist watch with a second, minute and hour arm.

This took me a while, so enjoy fourty (Some reputation points will help me as well...:$)

FIRST, copy the attached ocx to your windows system32 file.IMPORTANT, >>> remove the d from the .docx to make it ocx again. You then need to register the ocx by clicking on start, run, type in regsvr32 AlphaImageControl.ocx and click on ok.

Open the application attached and enjoy. You can use the alphaimage control royal free, I can't remember where I downloaded from, it was at a time when I had to include png images in my application. This image control can handle all of that and more. For more uses on the control, google AlphaImageControl.

If you want Analog clock follow Adrerets post if you want Digital Clock try below
Do the following.
1. Add a Timer on the Form
2. Set the Timer Interval = 1000
3. Add one Label on your form
4. Add this code

Private Sub Timer1_Timer()
      Label1.Caption = Format(Time, "HH:MM:SS AMPM")
      End Sub

Thanks

I like that Andre, see u on Monday,
By the way how did it go...?

Cool man. mmm, How did it go with?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.