Advertisement
NiCz

How To Make A Form Shaker In Visual Basic 2008/2010

Aug 31st, 2012
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.85 KB | None | 0 0
  1. How To Make A Form Shaker in Visual Basic 2008/2010
  2. ~
  3. Requirement:
  4. - Button
  5. ~
  6. Paste the codes below to your button.
  7. ~
  8.  
  9. Dim a As Integer 'Declaring integer "a"
  10.  
  11. While a < 10 'Starting a "while loop"
  12.  
  13. 'Setting our form's X position to 20 'pixels to right from it's current position.            
  14. Me.Location = New Point(Me.Location.X + 20, Me.Location.Y)
  15.            
  16. 'Telling a program to sleep for 50 miliseconds before 'continuing
  17. System.Threading.Thread.Sleep(50)
  18.  
  19. 'Setting our form's X position to 20 'pixels to left from it's current position.
  20. Me.Location = New Point(Me.Location.X - 20, Me.Location.Y)
  21.  
  22. 'Telling a program to sleep for 50 miliseconds before continuing            
  23. System.Threading.Thread.Sleep(50)
  24.            
  25. a += 1 'Increasing integer "a" by 1 after each loop
  26.        
  27. End While
  28.  
  29. -- DEBUG --
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement