VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   3015
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   3810
   DrawWidth       =   2
   LinkTopic       =   "Form1"
   ScaleHeight     =   3015
   ScaleWidth      =   3810
   StartUpPosition =   3  '窗口缺省
   Begin VB.Timer Timer1 
      Interval        =   1000
      Left            =   3240
      Top             =   1860
   End
   Begin VB.Line Line4 
      BorderWidth     =   4
      Index           =   0
      Visible         =   0   'False
      X1              =   240
      X2              =   720
      Y1              =   2280
      Y2              =   2280
   End
   Begin VB.Line Line3 
      X1              =   240
      X2              =   1620
      Y1              =   2520
      Y2              =   2520
   End
   Begin VB.Line Line2 
      BorderWidth     =   2
      X1              =   240
      X2              =   1440
      Y1              =   2700
      Y2              =   2700
   End
   Begin VB.Line Line1 
      BorderWidth     =   3
      X1              =   240
      X2              =   1200
      Y1              =   2880
      Y2              =   2880
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim pi As Double                            ' 声明窗体级变量
Private Sub Form_Load()
    pi = 3.14159265358979
    cx = Form1.ScaleWidth / 2: cy = Form1.ScaleHeight / 2
    Scale (-cx, cy)-(cx, -cy)                       ' 定义坐标系
    For i = 1 To 12                         ' 每30°画一刻度线
        aif = pi * (i - 1) / 6
        Load Line4(i)                           ' 1000，1200为刻度起终点半径
        Line4(i).X1 = 1000 * Cos(aif): Line4(i).Y1 = 1000 * Sin(aif)
        Line4(i).X2 = 1200 * Cos(aif): Line4(i).Y2 = 1200 * Sin(aif)
        Line4(i).Visible = True
    Next i
    Timer1_Timer
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)
    aif = ss * pi / 30 + pi / 2                     ' 秒针与坐标轴的夹角
    Line3.X1 = 100 * Cos(aif): Line3.Y1 = -100 * Sin(aif)
    Line3.X2 = 1000 * Cos(aif - pi): Line3.Y2 = -1000 * Sin(aif - pi)
    aif = mm * pi / 30 + pi / 2                     ' 分针与坐标轴的夹角
    Line2.X1 = 100 * Cos(aif): Line2.Y1 = -100 * Sin(aif)
    Line2.X2 = 900 * Cos(aif - pi): Line2.Y2 = -900 * Sin(aif - pi)
    aif = hh * pi / 6 + mm * pi / 360 + pi / 2          ' 时针与坐标轴的夹角
    Line1.X1 = 100 * Cos(aif): Line1.Y1 = -100 * Sin(aif)
    Line1.X2 = 700 * Cos(aif - pi): Line1.Y2 = -700 * Sin(aif - pi)
End Sub

