Makes a form vibrate.
Makes a form vibrate.
API Declarations
Create a new project and add a command button to the form then copy the code into the form. Play around with the numbers in the button event to change the way it vibrates.
Rate Makes a form vibrate.
(1(1 Vote))
Vibrate Form1, 100, 30
End Sub
Private Sub Form_Unload(Cancel As Integer)
End
End Sub
Public Sub Pause(ms)
secs = ms / 1000
G = Timer
Do While Timer - G < secs: DoEvents: Loop
End Sub
Public Sub Vibrate(frm As Form, rScale As Integer, Times As Integer)
Dim Lft As Long, Tp As Long
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
Makes a form vibrate. Comments
No comments yet — be the first to post one!
Post a Comment