OguzhanUyanik Mareşal
Mesaj Sayısı : 472 Kayıt tarihi : 31/08/09 Yaş : 32 Nerden : Konya İş/Hobiler : Bilgisyar-Yazılım Lakap : Nediz
| Konu: Visual Basic Saat Salı Eyl. 08, 2009 12:02 am | |
| Saat Klasik görünümlü duvar saati | Private Declare Function sndPlaySound Lib "WINMM.DLL" Alias "sndPlaySoundA" (ByVal lpszSoundName As Any, ByVal uFlags As Long) As Long
Dim Ses As Long
Dim P, K, Saat, Daki, S, gun, XA, XB, YA, YB, Ala As Integer
Dim San, Dak, Saa As Double
Private Sub Form_Load()
Timer1.Interval = 1000
Line5.Visible = False: Ala = 1: Text1.Visible = False: Tuş(0).Visible = False: Tuş(1).Visible = False
Form1.Left = Int((Screen.Width - 11085) / 2): Form1.Top = Int((Screen.Height - 11085) * 3 /
T1 = Val(Left(Time, 2)): T2 = Val(Mid(Time, 4, 2)): T3 = Val(Right(Time, 2))
San = T3 * 6 - 90: Dak = T2 * 6 - 90 (T3 * 6 / 60): Saa = T1 * 30 - 90 ((T2 * 60 T3) * 1 / 120)
XA = 5527: XB = 5527: YA = 5527: YB = 5527: K = 0: P = 0
For S = 0 To 60
Line4(S).X1 = XA Cos(S * 6 * (22 / 7) / 180) * 4080: Line4(S).Y1 = YA Sin(S * 6 * (22 / 7) / 180) * 4080
Line4(S).X2 = XA Cos(S * 6 * (22 / 7) / 180) * 3800: Line4(S).Y2 = YA Sin(S * 6 * (22 / 7) / 180) * 3800
Line4(S).BorderColor = &H4080&: Line4(S).BorderWidth = 1
If S Mod 5 = 0 Then Line4(S).BorderWidth = 3: Line4(S).BorderColor = &HFF0000
Next S
End Sub
Private Sub Timer1_Timer()
T1 = Val(Left(Time, 2)): T2 = Val(Mid(Time, 4, 2)): T3 = Val(Right(Time, 2))
San = San 6: Dak = Dak 6 / 60: Saa = Saa 1 / 120
If T3 = 0 Then San = -90
Line1.X2 = XB Cos(San * (22 / 7) / 180) * 5000: Line1.Y2 = YB Sin(San * (22 / 7) / 180) * 5000
Line1.X1 = XA - Cos(San * (22 / 7) / 180) * 1000: Line1.Y1 = YA - Sin(San * (22 / 7) / 180) * 1000
Line2.X2 = XB Cos(Dak * (22 / 7) / 180) * 4000: Line2.Y2 = YB Sin(Dak * (22 / 7) / 180) * 4000
Line2.X1 = XA - Cos(Dak * (22 / 7) / 180) * 900: Line2.Y1 = YA - Sin(Dak * (22 / 7) / 180) * 900
Line3.X2 = XB Cos(Saa * (22 / 7) / 180) * 2700: Line3.Y2 = YB Sin(Saa * (22 / 7) / 180) * 2500
Line3.X1 = XA - Cos(Saa * (22 / 7) / 180) * 800: Line3.Y1 = YA - Sin(Saa * (22 / 7) / 180) * 800
Ses = sndPlaySound("C:\\WINDOWS\\Media\\Windows XP Menü Komutu", &H1)
Label3(0) = Time: Ala = 1
M = Array("Ocak", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık")
Label3(1) = Mid(Date, 1, 2) " " M(Mid(Date, 4, 2) - 2) " " Mid(Date, 7, 4)
gun = Array("Pazar", "Pazartesi", "Salı", "Çarşamba", "Perşembe", "Cuma", "Cumartesi")
Label3(2) = gun(Weekday(Date) - 1)
If T2 = 0 And T3 = 0 Then Ses = sndPlaySound("C:\\WINDOWS\\Media\\ringin", &H1)
If T2 = 30 And T3 = 0 Then Ses = sndPlaySound("C:\\WINDOWS\\Media\\ringout", &H1)
If Ala = 1 Then K = K 1: If K = 20 Then Text1.Visible = False: Tuş(0).Visible = False: Tuş(1).Visible = False: K = 0
If Mid(Label3(0), 4, 2) = Right(Text1, 2) And Left(Label3(0), 2) = Left(Val(Text1), 2) Then Ses = sndPlaySound("C:\\WINDOWS\\Media\\ringin", &H1)
End Sub
Private Sub Image1_Click()
If Line5.Visible = True Then Line5.Visible = False: Ala = 0: Text1.Visible = False:: Tuş(0).Visible = False: Tuş(1).Visible = False: Tuş(0).Enabled = False: Tuş(1).Enabled = False
If Ala = 1 Then
Tuş(0).Enabled = True: Tuş(1).Enabled = True: Text1.Locked = True: Saat = 0: Daki = 0
Line5.Visible = True: Text1.Visible = True:: Tuş(0).Visible = True: Tuş(1).Visible = True
Line5.X1 = XA: Line5.Y1 = YA: Text1.Text = "00:00"
Line5.X2 = XA Cos(-90 * (22 / 7) / 180) * 3600: Line5.Y2 = YA Sin(-90 * (22 / 7) / 180) * 3600
End If
S = -90
End Sub
Private Sub Tuş_Click(X As Integer)
M1 = Array("00", "12", "24", "36", "48")
M2 = Array("00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23")
If X = 1 Then Saat = Val(Saat): Saat = Saat 1: S = S 30:
If X = 0 Then
Daki = Val(Daki): Daki = Daki 1: S = S 6: If Daki > 4 Then Daki = 0: Saat = Saat 1
End If
If Saat > 23 Then Saat = 0
Line5.X1 = XA: Line5.Y1 = YA
Line5.X2 = XA Cos(S * (22 / 7) / 180) * 3600: Line5.Y2 = YA Sin(S * (22 / 7) / 180) * 3600
Text1.Text = M2(Saat) ":" M1(Daki)
End Sub
| |
|