‘校验时间?自己加进去,还不如同步
Option Explicit
Const hh = 0
Const mh = 13
Const sh = 14
Private Sub Form_Load()
Timer1.Interval = 100
With Me
.Width = 4000
.Height = 4000
.Left = Screen.Width \ 2 - 2000
.Top = (Screen.Height - Height) \ 2
End With
End Sub
Private Sub Form_Resize()
Dim i, angle
Static flag As Boolean
If flag = False Then
flag = True
For i = 0 To 14
If i > 0 Then Load Line1(i)
With Line1(i)
.Visible = True
.BorderWidth = 5
.BorderColor = RGB(200, 100, 60)
End With
Next
End If
For i = 0 To 14
Scale (-1, 1)-(1, -1)
angle = i * 2 * Atn(1) / 3
With Line1(i)
.X1 = 0.9 * Cos(angle)
.Y1 = 0.9 * Sin(angle)
.X2 = Cos(angle)
.Y2 = Sin(angle)
End With
Next
End Sub
Private Sub Timer1_Timer()
Dim angle
Static ls
If Second(Now) = ls Then Exit Sub
ls = Second(Now)
angle = 0.5236 * (15 - (Hour(Now) + Minute(Now) / 60))
With Line1(hh)
.X1 = 0
.Y1 = 0
.X2 = 0.3 * Cos(angle)
.Y2 = 0.3 * Sin(angle)
End With
angle = 0.1047 * (75 - (Minute(Now) + Second(Now) / 60))
With Line1(mh)
.X1 = 0
.Y1 = 0
.X2 = 0.7 * Cos(angle)
.Y2 = 0.7 * Sin(angle)
End With
angle = 0.5236 * (75 - Second(Now) / 5)
With Line1(sh)
.X1 = 0
.Y1 = 0
.X2 = 0.8 * Cos(angle)
.Y2 = 0.8 * Sin(angle)
End With
Me.Caption = Str(Now())
End Sub
做了一个指针式动态时钟,是以系统时间显示的,有时、分、秒的指针,也有数字显示。
但是没有你说的校时功能,因为是系统时间,不需要校时。秒针的角度转动同时改变分针和时针的角度转动,并且最小转动角度为6度(一圈是360度,符合60分、60秒的进制)。
已经做好了,邮箱?发给你。
不清楚