C# Code Snippets

Jiggle

Adonis Deliannis

This little snippet jiggles(shakes) your windows form. It's epic to tease your friends or to have as an Error for your Future program.

Platform: .NET Framework 2.0

//Copyright - Adonis S. Deliannis
public void Jiggle()
{
     int X = this.Location.X;
     int Y = this.Location.Y;
     Random r = new Random();
     int JiggleCount = 0;
     int Z = 15;

     while (JiggleCount < 1000)
     {
         this.Location = new Point(r.Next(X - Z, X + Z), r.Next(Y - Z, Y + Z));
         JiggleCount++;
     }

     JiggleCount = 0;
     this.Location = new Point(X, Y);
}

 

Back to C# Code Snippet List

Other C# Articles
Unable to connect to database! Please try again later.