Contoh Program Jam ANALOG dan DIGITAL

Sobat, saya share contoh program jam, Analog dan Digital yang digabungkan. Ini mungkin suka sering diperlukan untuk tugas-tugas di Universitas Gunadarma yang disuruh buat program dengan menggunakan Timer. Hasil outputnya dibawah ini :
Contoh Program Jam ANALOG dan DIGITAL


Dengan menambahkan program dibawah ini :
Option Explicit

Private Const pi As Double = 3.14159265358979

Private Declare Function CreateRoundRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long, ByVal X3 As Long, ByVal Y3 As Long) As Long
Private Declare Function ReleaseCapture Lib "user32" () As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long

Private Sub MakeRoundObject(objObject As Object, Value As Long)
Static lngHeight, lngLong, lngReturn, lngWidth As Long

lngWidth = objObject.Width / Screen.TwipsPerPixelX
lngHeight = objObject.Height / Screen.TwipsPerPixelY

SetWindowRgn objObject.hWnd, CreateRoundRectRgn(0, 0, lngWidth, lngHeight, Value, Value), True
End Sub

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyEscape Then
App.TaskVisible = False
Unload Me
End
End If
End Sub

Private Sub Form_Load()
Dim intX As Integer

Call MakeRoundObject(frmMain, 20)
Call tmrClock_Timer

For intX = 0 To 360 Step 6
If intX Mod 30 = 0 Then
Me.DrawWidth = 6
Me.PSet (1100 * Cos(intX * pi / 180) + lineSecond.X1, 1100 * Sin(intX * pi / 180) + lineSecond.Y1)
Else
Me.DrawWidth = 3
Me.PSet (1100 * Cos(intX * pi / 180) + lineSecond.X1, 1100 * Sin(intX * pi / 180) + lineSecond.Y1)
End If
Next intX
End Sub

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
ReleaseCapture
SendMessage Me.hWnd, &HA1, 2, 0&
End Sub

Private Sub Image2_Click()

Unload Me
End Sub

Private Sub Imagestart_Click()
Xmili.Caption = “00"
xdetik.Caption = “00"
xmenit.Caption = “00"
Timer1.Enabled = True
Imagestart.Enabled = False
Imagestop.Enabled = True
End Sub

Private Sub Imagestop_Click()
Timer1.Enabled = False
Imagestart.Enabled = True
Imagestop.Enabled = False
End Sub

Private Sub lblTime_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call Form_MouseDown(Button, Shift, X, Y)
End Sub

Private Sub Picture1_Click()

End Sub

Private Sub Timer1_Timer()
Xmili.Caption = Val(Xmili.Caption) + 1
If Len(Xmili.Caption) = 1 Then Xmili.Caption = “0? & Xmili.Caption
If Xmili.Caption = “60? Then
Xmili.Caption = “00?
xdetik.Caption = Val(xdetik.Caption) + 1
If Len(xdetik.Caption) = 1 Then xdetik.Caption = “0? & xdetik.Caption
End If
If xdetik.Caption = “60? Then
xdetik.Caption = “00?
xmenit.Caption = Val(xmenit.Caption) + 1
If Len(xmenit.Caption) = 1 Then xmenit.Caption = “0? & xmenit.Caption
End If
End Sub

Private Sub tmrClock_Timer()
Dim dblSecond As Double, dblMinute As Double, dblHour As Double

dblSecond = Second(Now) * 6 - 90
dblMinute = (Minute(Now) + Second(Now) / 60) * 6 - 90
dblHour = (Hour(Now) + Minute(Now) / 60) * 30 - 90

lineSecond.X2 = 1000 * Cos(dblSecond * pi / 180) + lineSecond.X1
lineSecond.Y2 = 1000 * Sin(dblSecond * pi / 180) + lineSecond.Y1
lineMinute.X2 = 900 * Cos(dblMinute * pi / 180) + lineMinute.X1
lineMinute.Y2 = 900 * Sin(dblMinute * pi / 180) + lineMinute.Y1
Linehour.X2 = 700 * Cos(dblHour * pi / 180) + Linehour.X1
Linehour.Y2 = 700 * Sin(dblHour * pi / 180) + Linehour.Y1

Lbltime.Caption = Format(Now, "hh:mm:ss")
End Sub
Keterangan : 
  1. Anda tinggal menambahkan gambar dengan membuatnya dengan photoshop sesuai keinginan anda.
  2. Atur semua properti dan disesuaikan dengan program diatas, mungkin anda rata-rata sudah bisa.
  3. Bila anda memerlukan gambar yg serupa dengan gambar saya, tinggal anda unduh saja dibawah ini :
Contoh Program Jam ANALOG dan DIGITAL

Contoh Program Jam ANALOG dan DIGITAL
Perhatian Copas !!! "Mohon bagi anda para sahabat blog, jangan sekali-kali copy paste dengan tanpa mencantumkan link sumber kami dan menulis tanpa anda tulis dalam narasi atau kalimat anda sendiri saya akan mengapus url anda sesuai kebijakan privasi google DMCA/DMCA.com. Atas perhatiannya, saya ucapkan terimakasih."
Next
Previous

2 comments

  1. sipp dch gan info nya bermanfaat bagi ane

    ReplyDelete
    Replies
    1. makasi atas kunjungannya gan, sama sama ! =D

      Delete

aturan berkomentar pada blog ini !.
1. berkomentarlah dengan baik, sesuai konten yang dibahas dan berkualitas.
2. kalimat yang tidak berkenan saya akan hapus.
3. jika menaruh "LINK HIDUP" akan dimasukan ke folder spam.
4. dilarang mempromosikan produk melalui komentar.

Emoticon