Kali ini yang kita butuhkan yaitu sebuah form, 3 line, 1 shape, dan sebuah timer. Dan seperti biasa kita membutuhkan Visual basic 6.0, berikut propertiesnya:
- form >> borderstyle = 1 - fixed single
- line1 >> name = jarumjam, & border width = 3
- line2 >> name = jarummenit, & border width = 2
- line3 >> name = jarumdetik, & border width = 1
- shape >> name = bingkai
- Timer >> name = timer, Interval = 1000, & enable = true
Option Explicit
dim Pjjam as integer
dim pjmenit as integer
dim pjdetik as integer
dim pusatX as integer
dim PusatY as integer
Sub Hitungskala()
bingkai.Top = 0
bingkai.left = 0
bingkai.height = me.scaleheight
bingkai.width = me.scalewidth
Pjjam = (4 / 10 * me.scaleheight) \ 2
Pjmenit = (6 / 10 * me.scaleheight) \ 2
Pjdetik = (8 / 10 * me.scaleheight) \ 2
Pusatx = me.scalewidth \ 2
pusaty = me.scaleheight \ 2
end sub
Private sub aturjarumjam()
dim jamsekarang as single
dim sudutjam as integer
dim x, y
jamsekarang = (now - int(now)) * 24
sudutjam = (jamsekarang - 1) * -30 + 60
x = Pjjam * cos (sudutjam * 3.14 / 180)
y = Pjjam * sin (sudutjam * 3.14 / 180)
jarumjam.X1 = pusatx
jarumjam.Y1 = pusaty
jarumjam.x2 = pusatx + x
jarumjam.Y2 = pusaty - y
end sub
Private sub aturjarummenit()
dim waktusekarang as single
dim menitsekarang as integer
dim sudutmenit as integer
dim x, y
waktusekarang = (now - int(now)) * 24
menitsekarang = (waktusekarang - int(waktusekarang)) * 60
sudutmenit = (menitsekarang - 1) * -6 + 84
x = Pjmenit * cos (sudutmenit * 3.14 / 180)
y = Pjmenit * sin (sudutmenit * 3.14 / 180)
jarummenit.X1 = pusatx
jarummenit.Y1 = pusaty
jarummenit.x2 = pusatx + x
jarummenit.Y2 = pusaty - y
end sub
Private sub aturjarumdetik()
dim waktusekarang as single
dim detiksekarang as integer
dim sudutdetik as integer
dim x, y
waktusekarang = (now - int(now)) * 24 * 60
detiksekarang = (waktusekarang - int(waktusekarang)) * 60
sudutdetik = (detiksekarang - 1) * -6 + 84
x = Pjdetik * cos (sudutdetik * 3.14 / 180)
y = Pjdetik * sin (sudutdetik * 3.14 / 180)
jarumdetik.X1 = pusatx
jarumdetik.Y1 = pusaty
jarumdetik.x2 = pusatx + x
jarumdetik.Y2 = pusaty - y
end sub
Private sub aturjarum()
call aturjarumjam
call aturjarummenit
call aturjarumdetik
end sub
private sub form_load()
me.height = 3000
me.width = 3000
call hitungskala
me.visible = true
call aturjarum
jarumjam.visible = true
jarummenit.visible = true
jarumdetik.visible = true
end sub
private sub form_resize()
call hitungskala
end sub
private sub Timer_timer()
call aturjarum
end sub
Selesai..!!!!
Bagaimana apakah program kamu berjalan atau tidak..??? dan tentunya Waktu luang mu Tak terbuang sia-siakan...???
4 comments
Wah makasih banget.. Ane kebantu..
Reply==== ebenk789 ====

Reply@ liet: Sama-saMa
====== berbagi itu indah =====
walahhhh boz...da ekualiser'nya g nie...??
Replymohon riplenyah iah boz...
matur tengkyu pak boz...
Cuma bengong !!
ReplyPost a Comment