窗体抖动

//实现窗体抖动的效果
Point first = this.Location;
for (int i = 0; i < 30; i++)
{
  Random ran = new Random();
  Point p = new Point(this.Location.X + ran.Next(10) - 4, this.Location.Y +
  ran.Next(10) - 4);
  System.Threading.Thread.Sleep(15);//当前线程挂起15毫秒
  this.Location = p;
  System.Threading.Thread.Sleep(15);//当前线程再挂起15毫秒

}

this.Location = first; //将窗体还原为原来的位置

----------------------------------------------------------------------------
创建于2017年5月11日

整理于2017年11月30日

原文地址:https://www.cnblogs.com/kanjinxiang/p/7928535.html