1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
/// <summary>
/// Shakes the window.
/// </summary>
private void ShakeWindow()
{
System.Drawing.Point startingPosition = Location;
Random rnd = new Random();
int x = startingPosition.X;
int y = startingPosition.Y;
for (int i = 0; i < 30; i++)
{
x = x + rnd.Next(-5, 5);
y = y + rnd.Next(-5, 5);
Location = new System.Drawing.Point(x, y);
x = startingPosition.X;
y = startingPosition.Y;
System.Threading.Thread.Sleep(30);
}
Location = startingPosition;
}
|