Üye Kayıt Üye Giriş

Analog ve Dijital Saat


Analog ve Dijital Saat

 
Public gme As Integer
Public g As Single
Public mm As Integer
Public hh As Single
Public chane As Boolean
Public fr As Integer
Public i As Integer
Private Sub Command1_Click()
Timer2.Enabled = True
End Sub

Private Sub Form_Load()
tim = Time$
at = Right(tim, 2)
g = 45 + at
If g > 60 Then g = g - 60
am = Right(tim, 5)
am = Left(am, 2)
mm = 45 + am
If mm > 60 Then mm = mm - 60

ah = Left(tim, 2)
ah = ah - 12
hh = 45 + (ah * 5)
If hh > 60 Then hh = hh - 60

Shape1.Height = 3600
Shape1.Width = 3600
Shape1.Top = 0
Shape1.Left = 0
Line4(0).X1 = 1800
Line4(0).Y1 = 1800
Line4(0).Y2 = 1800
Line4(0).X2 = 1800
Me.Width = 3725
End Sub

Private Sub Timer1_Timer()
f0 = (2 * 3.14) / 60
g = g + 1
If g = 61 Then
g = 1
End If
If mm = 61 Then
mm = 1
End If
If hh = 61 Then
hh = 1
End If

If g = 45 Then
mm = mm + 1
If fr < 2 Then
fr = fr + 1
End If
chane = False
End If

If mm = 45 And chane = False Then
hh = hh + 5
chane = True
End If
f = g * f0
x = 1500 * Cos(f)
y = 1500 * Sin(f)

Line1.X1 = 1800
Line1.Y1 = 1800
Line1.Y2 = y + 1800
Line1.X2 = x + 1800

If fr = 1 Then
i = i + 1
Load Line4(i)
Line4(i).Visible = True
Line4(i).X1 = Line1.X2
Line4(i).X2 = Line1.X2
Line4(i).Y1 = Line1.Y2
Line4(i).Y2 = Line1.Y2

qw = (i - 1) \ 5
f = qw * 5
If f = i - 1 Then
Line4(i).BorderColor = &HC0C000
Line4(i).BorderWidth = 5
End If
End If

fm = mm * f0
xm = 1250 * Cos(fm)
ym = 1250 * Sin(fm)

Line2.X1 = 1800
Line2.Y1 = 1800
Line2.X2 = xm + 1800
Line2.Y2 = ym + 1800

fh = hh * f0
xh = 900 * Cos(fh)
yh = 900 * Sin(fh)

Line3.X1 = 1800
Line3.Y1 = 1800
Line3.X2 = xh + 1800
Line3.Y2 = yh + 1800
Label1.Caption = Time$
End Sub

Bilgisayar Dershanesi Ders Sahibi;
Bilgisayar Dershanesi

Yorumlar

Yorum Yapabilmek İçin Üye Girişi Yapmanız Gerekmektedir.

ETİKETLER