Persiapan yang di lakukan :
Buat Project baru stardart exe .. lalu ketik coding berikut pada form sobat
Private Sub Vibrate(frm As Form, rScale As Integer, Times As Integer)
Dim Lft As Long, Tp As Long
Dim i
Lft = frm.Left
Tp = frm.Top
For i = 1 To Times
frm.Move Lft + Sgn(rScale)
Pause 20
frm.Move Lft + rScale
Pause 20
frm.Move Lft, Tp + Sgn(rScale), frm.Width, frm.Height
Pause 20
frm.Move Lft, Tp + rScale, frm.Width, frm.Height
Pause 20
Next i
End Sub
Private Sub Pause(ms)
Dim secs
Dim g
secs = ms / 1000
g = Timer
Do While Timer - g < secs
DoEvents
Loop
End Sub
Private Sub Form_Activate()
Vibrate Me, 100, 20
End Sub
Dim Lft As Long, Tp As Long
Dim i
Lft = frm.Left
Tp = frm.Top
For i = 1 To Times
frm.Move Lft + Sgn(rScale)
Pause 20
frm.Move Lft + rScale
Pause 20
frm.Move Lft, Tp + Sgn(rScale), frm.Width, frm.Height
Pause 20
frm.Move Lft, Tp + rScale, frm.Width, frm.Height
Pause 20
Next i
End Sub
Private Sub Pause(ms)
Dim secs
Dim g
secs = ms / 1000
g = Timer
Do While Timer - g < secs
DoEvents
Loop
End Sub
Private Sub Form_Activate()
Vibrate Me, 100, 20
End Sub
Gak panjang kan, nah kalo udah selesai coba sobat jalankan (Run) atau tekan F5 , apa bener form nya bergetar-getar seperti cacing kepanasan ... (wekekeke ....), selamat mencoba aja yah.
mudah-mudahan ada mamfaat nya bagi kita semua dan khusus nya bagi VB Developer Junior semoga dapat menambah referensinya, sebelumnya terimakasih buat sobat-sobat yang sudah sudi mengkomentari artikel ini ... salam.
0 komentar:
Posting Komentar