VERSION 5.00
Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0"; "COMCTL32.OCX"
Begin VB.Form frm1 
   BackColor       =   &H00C0C0FF&
   Caption         =   "Часы"
   ClientHeight    =   5325
   ClientLeft      =   3825
   ClientTop       =   1740
   ClientWidth     =   4605
   LinkTopic       =   "Form1"
   ScaleHeight     =   5325
   ScaleWidth      =   4605
   Begin ComctlLib.Slider sld1 
      Height          =   372
      Left            =   2280
      TabIndex        =   5
      Top             =   4200
      Width           =   2052
      _ExtentX        =   3625
      _ExtentY        =   661
      _Version        =   327682
   End
   Begin VB.CommandButton cmdSld 
      Caption         =   "Регулировка"
      Height          =   375
      Left            =   240
      TabIndex        =   4
      Top             =   4200
      Width           =   1695
   End
   Begin VB.TextBox txtHour 
      Height          =   375
      Left            =   2040
      TabIndex        =   2
      Top             =   3600
      Width           =   855
   End
   Begin VB.PictureBox picWatch 
      BackColor       =   &H00FFFFFF&
      FillColor       =   &H00FFFFFF&
      Height          =   3015
      Left            =   600
      ScaleHeight     =   2955
      ScaleWidth      =   3315
      TabIndex        =   1
      Top             =   360
      Width           =   3375
   End
   Begin VB.CommandButton cmdStart 
      Caption         =   "Пуск"
      Height          =   495
      Left            =   1440
      TabIndex        =   0
      Top             =   4680
      Width           =   1335
   End
   Begin VB.Label lblHour 
      Alignment       =   2  'Center
      BackColor       =   &H00FFFFFF&
      Caption         =   "Заведите часы"
      Height          =   375
      Left            =   240
      TabIndex        =   3
      Top             =   3600
      Width           =   1695
   End
End
Attribute VB_Name = "frm1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim bytN As Byte, dblHour, dblN, dblT, dblS As Double
Private Sub cmdSld_Click()
dblS = sld1.Value
End Sub
Private Sub cmdStart_Click()
'Масштаб
picWatch.Scale (-6, 6)-(6, -6)
'Завод часов
dblHour = Val(txtHour)
'Циферблат
picWatch.Circle (0, 0), 5
For bytN = 1 To 12
picWatch.FillStyle = 0: picWatch.FillColor = vbYellow
picWatch.Circle (3 * Sin(6.28 / 12 * bytN), 3 * Cos(6.28 / 12 * bytN)), 0.35
picWatch.PSet (4 * Sin(6.28 / 12 * bytN) - 0.5, 4 * Cos(6.28 / 12 * bytN) + 0.3), vbWhite
picWatch.Print bytN
Next bytN
'Анимация движения стрелок
For dblN = 1 To 360 * dblHour
picWatch.Circle (0, 0), 0.2
picWatch.Line (0, 0)-(2.5 * Sin(6.28 / 360 * dblN), 2.5 * Cos(6.28 / 360 * dblN))
picWatch.Line (0, 0)-(2 * Sin(6.28 / 21600 * dblN), 2 * Cos(6.28 / 21600 * dblN))
picWatch.Line (0, 0)-(1.5 * Sin(6.28 / 1296000 * dblN), 1.5 * Cos(6.28 / 1296000 * dblN))
For dblT = 1 To 1000 * dblS
Next dblT
picWatch.Line (0, 0)-(2.5 * Sin(6.28 / 360 * dblN), 2.5 * Cos(6.28 / 360 * dblN)), vbWhite
picWatch.Line (0, 0)-(2 * Sin(6.28 / 21600 * dblN), 2 * Cos(6.28 / 21600 * dblN)), vbWhite
picWatch.Line (0, 0)-(1.5 * Sin(6.28 / 1296000 * dblN), 1.5 * Cos(6.28 / 1296000 * dblN)), vbWhite
Next dblN
'Положение стрелок в момент остановки часов
picWatch.Line (0, 0)-(2.5 * Sin(6.28 / 360 * dblN), 2.5 * Cos(6.28 / 360 * dblN))
picWatch.Line (0, 0)-(2 * Sin(6.28 / 21600 * dblN), 2 * Cos(6.28 / 21600 * dblN))
picWatch.Line (0, 0)-(1.5 * Sin(6.28 / 1296000 * dblN), 1.5 * Cos(6.28 / 1296000 * dblN))
picWatch.Circle (0, 0), 0.2
End Sub
