VERSION 4.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   3975
   ClientLeft      =   4050
   ClientTop       =   1950
   ClientWidth     =   3405
   Height          =   4380
   Left            =   3990
   LinkTopic       =   "Form1"
   ScaleHeight     =   3975
   ScaleWidth      =   3405
   Top             =   1605
   Width           =   3525
   Begin VB.PictureBox Picture2 
      AutoRedraw      =   -1  'True
      BorderStyle     =   0  'None
      Height          =   855
      Left            =   600
      ScaleHeight     =   855
      ScaleWidth      =   975
      TabIndex        =   1
      Top             =   2520
      Width           =   975
   End
   Begin VB.Timer Timer1 
      Interval        =   1000
      Left            =   0
      Top             =   2520
   End
   Begin VB.PictureBox Picture1 
      AutoRedraw      =   -1  'True
      BorderStyle     =   0  'None
      Height          =   2175
      Left            =   120
      ScaleHeight     =   2175
      ScaleWidth      =   2295
      TabIndex        =   0
      Top             =   120
      Width           =   2295
   End
End
Attribute VB_Name = "Form1"
Attribute VB_Creatable = False
Attribute VB_Exposed = False


Option Explicit
Dim CenterX As Long, CenterY As Long, MySize As Long
Dim PI As Double
Dim DPicture As PictureBox


Private Sub Form_Load()
    PI = 3.14159265359
    Set DPicture = Picture1
End Sub

Private Sub Form_Resize()
    Picture1.Width = Form1.ScaleWidth - Picture1.Left * 2
    Picture1.Height = Form1.ScaleHeight - Picture1.Top * 2
    CenterX = Picture1.ScaleWidth / 2
    CenterY = Picture1.ScaleHeight / 2
    If CenterX > CenterY Then CenterX = CenterY
    If CenterY > CenterX Then CenterY = CenterX
    MySize = CenterX / 50
    Picture2.Top = Picture1.Top
    Picture2.Left = Picture1.Left
    Picture2.Width = Picture1.Width
    Picture2.Height = Picture1.Height
End Sub


Private Sub Timer1_Timer()
    If DPicture = Picture1 Then
        Set DPicture = Picture2
    Else
        Set DPicture = Picture1
    End If
    DrawClock
    DPicture.ZOrder 0
End Sub
 
Private Sub DrawClock()
    Dim X As Long, Y As Long, Rad As Double
    Dim X1 As Long, Y1 As Long
    
    DPicture.Cls
    
    X = CenterX
    
    Y = MySize * 2
    For Rad = PI * 2 To 0 Step -(PI / 6)
        X1 = Math.Cos(Rad) * (X - CenterX) + Math.Sin(Rad) * (Y - CenterY)
        Y1 = Math.Cos(Rad) * (Y - CenterY) - Math.Sin(Rad) * (X - CenterX)
        DrawDot X1, Y1
    Next Rad

    Y = MySize * 25
    DPicture.DrawWidth = MySize / 5
    
    Rad = -PI / 6 * Hour(Time)
    X1 = Math.Cos(Rad) * (X - CenterX) + Math.Sin(Rad) * (Y - CenterY)
    Y1 = Math.Cos(Rad) * (Y - CenterY) - Math.Sin(Rad) * (X - CenterX)
    DPicture.Line (CenterX, CenterY)-(X1 + CenterX, Y1 + CenterY), RGB(0, 0, 0)

    Y = MySize * 4
    DPicture.DrawWidth = MySize / 10
    
    Rad = -PI / 30 * Minute(Time)
    X1 = Math.Cos(Rad) * (X - CenterX) + Math.Sin(Rad) * (Y - CenterY)
    Y1 = Math.Cos(Rad) * (Y - CenterY) - Math.Sin(Rad) * (X - CenterX)
    DPicture.Line (CenterX, CenterY)-(X1 + CenterX, Y1 + CenterY), RGB(100, 100, 100)

    Y = MySize * 4
    DPicture.DrawWidth = 1

    Rad = -PI / 30 * Second(Time)
    X1 = Math.Cos(Rad) * (X - CenterX) + Math.Sin(Rad) * (Y - CenterY)
    Y1 = Math.Cos(Rad) * (Y - CenterY) - Math.Sin(Rad) * (X - CenterX)
    DPicture.Line (CenterX, CenterY)-(X1 + CenterX, Y1 + CenterY), RGB(255, 0, 0)

    Form1.Caption = Format(Time, "hh:nn:ss")
End Sub

Private Sub DrawDot(X1, Y1)
    DPicture.Line ((X1 + CenterX) - MySize, (Y1 + CenterY) - MySize)-((X1 + CenterX) + MySize, (Y1 + CenterY) - MySize), RGB(255, 255, 255), B
    DPicture.Line ((X1 + CenterX) - MySize, (Y1 + CenterY) - MySize)-((X1 + CenterX) - MySize, (Y1 + CenterY) + MySize), RGB(255, 255, 255), B
    DPicture.Line ((X1 + CenterX) - MySize, (Y1 + CenterY) + MySize)-((X1 + CenterX) + MySize, (Y1 + CenterY) + MySize), RGB(0, 0, 0), B
    DPicture.Line ((X1 + CenterX) + MySize, (Y1 + CenterY) - MySize)-((X1 + CenterX) + MySize, (Y1 + CenterY) + MySize), RGB(0, 0, 0), B
End Sub

