VB icon

Earthquake Shake Effect

Email
Submitted on: 2/13/2015 8:44:00 AM
By: jBaron (from psc cd)  
Level: Intermediate
User Rating: By 3 Users
Compatibility: VB 3.0, VB 4.0 (16-bit), VB 4.0 (32-bit), VB 5.0, VB 6.0
Views: 492
 
     Makes a form shaking. << Earthquake Shake Effect >>
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
				
'**************************************
' Name: Earthquake Shake Effect
' Description:Makes a form shaking.
<< Earthquake Shake Effect >>
' By: jBaron (from psc cd)
'
' Assumes:My First Code In PSC
'**************************************

'Put this code in a module
'*********************** Author ****************************
'Earthquake Shake Effect
'Author: jBaron
'E-mail Address: jbaron@freemail.gr
'Website: www.hackedemonia.tk
'Dated on: 05-09-2005
'For any problems,suggestions please E-mail me.
'***********************************************************
' In a command button place the above code:
'example: << Call Shake(Form1,1,1000,100) >>
'
' a)b) c) d)
'a) Here we call a form.
'
'b) We give the State: 1 for shaking Horizontally,2 for shaking Vertically
'3 for shaking both Horizonally and Vertically.
'
'c) We give a number to say for How Long the form will be shaking.
'
'd) We give a number to say How Big the effect will be.
'Warning:
' # If You give a large number (Howlong) it wiil take a long time
'for the effect to pass out and may conflict your program.
' # Same happens with (Howbig).
Public Function Shake(Aform As Form, State As Integer, Howlong As Long, Howbig As Long)
Dim i As Long
If State = 1 Then
'--> Shakes Form LeftRight...
For i = 0 To Howlong
Aform.Left = Aform.Left + Howbig
Aform.Left = Aform.Left - Howbig
Next i
End If
If State = 2 Then
'--> Shakes Form UpDown...
For i = 0 To Howlong
Aform.Top = Aform.Top + Howbig
Aform.Top = Aform.Top - Howbig
Next i
End If
If State = 3 Then
'--> Shakes Form UpDown and LeftRight...
For i = 0 To Howlong
Aform.Left = Aform.Left + Howbig
Aform.Left = Aform.Left - Howbig
 
Aform.Top = Aform.Top + Howbig
Aform.Top = Aform.Top - Howbig
Next i
End If
End Function


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments


 There are no comments on this submission.
 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.