Option Explicit Const T As Double = 57.29577951 Private Sub Form_Load() Me.Height = 2048 Me.Width = 2048 End Sub Private Sub Form_Resize() Me.ScaleHeight = 100 Me.ScaleWidth = 100 End Sub Private Sub Timer1_Timer() Dim H As Long, M As Long, S As Long 'time units Dim Hd As Double, Md As Double, Sd As Double 'Degrees Dim Hr As Double, Mr As Double, Sr As Double 'Radians Me.Cls H = Hour(Time): M = Minute(Time): S = Second(Time) If H >= 12 Then H = H - 12 Hd = H * 30 Hd = Hd + M / 2 Md = M * 6 Sd = S * 6 Hd = Hd - 90: Md = Md - 90: Sd = Sd - 90 If Hd < 0 Then Hd = Hd + 360 If Md < 0 Then Md = Md + 360 If Sd < 0 Then Sd = Sd + 360 Hr = Hd / T: Mr = Md / T: Sr = Sd / T Line (50, 50)-(Me.ScaleHeight / 2 + ((Me.ScaleHeight / 2) * 0.5 * Cos(Hr)), Me.ScaleWidth / 2 + ((Me.ScaleHeight / 2) * 0.5 * Sin(Hr))), vbBlack Line (50, 50)-(Me.ScaleHeight / 2 + ((Me.ScaleHeight / 2) * 0.6 * Cos(Mr)), Me.ScaleWidth / 2 + ((Me.ScaleHeight / 2) * 0.6 * Sin(Mr))), vbBlue Line (50, 50)-(Me.ScaleHeight / 2 + ((Me.ScaleHeight / 2) * 0.7 * Cos(Sr)), Me.ScaleWidth / 2 + ((Me.ScaleHeight / 2) * 0.7 * Sin(Sr))), vbRed End Sub
*** MOD EDIT: Added code tags. Please
This post has been edited by JackOfAllTrades: 29 September 2009 - 06:40 AM

New Topic/Question
Reply





MultiQuote



|