Advertisement
Blizzardo1

Jiggle.cs

May 12th, 2011
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.87 KB | None | 0 0
  1. /* Jiggle.cs
  2.    Created by Adonis S. Deliannis ( Blizzardo1 )
  3.    Created on January 13, 2011
  4.    Uploaded to Youtube on January 14, 2011
  5.     This is a Jiggle Tutorial that will Jiggle your Window upon event.
  6.     Copyright (c) 2011 Adonis S. Deliannis, All rights reserved. (Update of 2012 due to reshare)
  7. */
  8. void Jiggle()
  9. {
  10.     int X = this.Location.X;    // Set the X Integer
  11.     int Y = this.Location.Y;    // Set the Y Integer
  12.     Random r = new Random();    // Create the Random Set that will Move our Window
  13.     int JiggleCount = 0;        // Set our Count to 0
  14.     int Z = 25;         // Set our Range to 25
  15.     while (JiggleCount < 1000)
  16.     {
  17.         // Set our new Location of out Window
  18.         this.Location = new Point(r.Next(X - Z, X + Z), r.Next(Y - Z, Y + Z));
  19.         JiggleCount++; // Increment our Count
  20.     }
  21.     JiggleCount = 0; // Reset Count to 0
  22.     this.Location = new Point(X, Y); // Put our Window back where it was
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement