Interactive analogue clock control

shalan99

Active member
Joined
Jun 1, 2007
Messages
32
Programming Experience
Beginner
Hi all,

Does anyone know if there is a time picker control that exists for VS.Net 2005 that resembles the clock used in Windows Mobile 5.0? Basically, instead of using the DateTimePicker, you can input time by dragging the hour and minute hands in the analogue clock.

Regards
shalan99
 
There's nothing in the Framework, although you could almost certainly find one or more third-party examples. I'd expect them not to be free though. You could also create your own using GDI+ to draw the clock face.
 
Hi jmcilhinney and thanx for the response. I'll look into GDI for drawing the face of the clock when I have some time this weekend. For now, I'm jus gonna use 2 DateTimePickers.

Thanx again!
 
The same approach is used for this Code Project article to display current time as analog clock. The transformed GraphicsPath that represent the time hands makes it easy to detect when clicking mouse down which hand it is. Then you have to calculate the angle from clock center when mouse is moving, this will tell the requested value of that hand. Attached is the linked project modified to allow changing time visually using the described methods.
 

Attachments

  • vbnet20-Clock.zip
    156.1 KB · Views: 39
Back
Top