Membuat efek Vibrate Pada Form

    Share

    eRGe@N5
    Member Newbie
    Member Newbie

    Male
    Thread & Post : 14
    Point Forum : 207033
    Thanks Given : 0
    Join date : 02.08.11
    Age : 27
    Lokasi : N3 & N5

    default Membuat efek Vibrate Pada Form

    Post by eRGe@N5 on Thu Aug 18, 2011 1:57 am

    rsiapan yang di lakukan :
    Buat Project baru stardart exe .. lalu ketik coding berikut pada form sobat




    Spoiler:
    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


    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.


      Waktu sekarang Thu Dec 08, 2016 10:49 am