# Earthquake Shake Effect

Posted: 2002-06-01
By: ArchiveBot
Viewed: 121

Filed Under:

VB6 Code Cache

No attachments for this post

Makes a form shaking.
<< Earthquake Shake Effect >>

Original Author: jBaron

### Assumptions

My First Code In PSC

### Code

`'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 LongIf State = 1 Then  '--> Shakes Form LeftRight...  For i = 0 To Howlong    Aform.Left = Aform.Left + Howbig    Aform.Left = Aform.Left - Howbig  Next iEnd IfIf State = 2 Then  '--> Shakes Form UpDown...  For i = 0 To Howlong    Aform.Top = Aform.Top + Howbig    Aform.Top = Aform.Top - Howbig  Next iEnd IfIf 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 iEnd IfEnd Function`