指针式时钟 不明白怎么该
Private Sub Form_Load()pi = 3.14159265358979
cx = Me.ScaleWidth / 2
cy = Me.ScaleHeight / 2
Scale (-cx, cy)-(cx, -cy)
For I = 1 To 12
alf = pi * (I - 1) / 6
Load Line4(I)
Line4(I).X1 = 1000 * Cos(alf)
Line4(I).Y1 = 1000 * Cos(alf)
Line4(I).X2 = 1200 * Cos(alf)
Line4(I).Y2 = 1200 * Cos(alf)
Line4(I).Visible = Ture
Next I
End Sub
Private Sub Form_Paint()
Circle (0, 0), 1400
End Sub
Private Sub Timer1_Timer()
hh = Hour(Time) Mod 12
mm = Minute(Time)
ss = Second(Time)
alf = ss * pi / 30 + pi / 2
Line3.X1 = 100 * Cos(alf)
Line3.Y1 = -100 * Sin(alf)
Line3.X2 = 1000 * Cos(alf - pi)
Line3.Y2 = -1000 * Sin(alf - pi)
alf = mm * pi / 30 + pi / 2
Line2.X1 = 100 * Cos(alf)
Line2.Y1 = -100 * Sin(alf)
Line2.X2 = 900 * Cos(alf - pi)
Line2.Y2 = -900 * Sin(alf - pi)
alf = hh * pi / 6 + mm * pi / 360 + pi / 2
Line1.X1 = 100 * Cos(alf)
Line1.Y1 = -100 * Sin(alf)
Line1.X2 = 700 * Cos(alf - pi)
Line1.Y2 = -700 * Sin(alf - pi)
End Sub
Private Sub Form_Load()
pi = 3.14159265358979
cx = Me.ScaleWidth / 2
cy = Me.ScaleHeight / 2
Scale (-cx, cy)-(cx, -cy)
For I = 1 To 12
alf = pi * (I - 1) / 6
Load Line4(I)
Line4(I).X1 = 1000 * Cos(alf)
Line4(I).Y1 = 1000 * Cos(alf)
Line4(I).X2 = 1200 * Cos(alf)
Line4(I).Y2 = 1200 * Cos(alf)
Line4(I).Visible = Ture
Next I
End Sub
Private Sub Form_Paint()
Circle (0, 0), 1400
End Sub
Private Sub Timer1_Timer()
hh = Hour(Time) Mod 12
mm = Minute(Time)
ss = Second(Time)
alf = ss * pi / 30 + pi / 2
Line3.X1 = 100 * Cos(alf)
Line3.Y1 = -100 * Sin(alf)
Line3.X2 = 1000 * Cos(alf - pi)
Line3.Y2 = -1000 * Sin(alf - pi)
alf = mm * pi / 30 + pi / 2
Line2.X1 = 100 * Cos(alf)
Line2.Y1 = -100 * Sin(alf)
Line2.X2 = 900 * Cos(alf - pi)
Line2.Y2 = -900 * Sin(alf - pi)
alf = hh * pi / 6 + mm * pi / 360 + pi / 2
Line1.X1 = 100 * Cos(alf)
Line1.Y1 = -100 * Sin(alf)
Line1.X2 = 700 * Cos(alf - pi)
Line1.Y2 = -700 * Sin(alf - pi)
End Sub