阚金翔
达则兼济天下,穷则独善其身

//实现窗体抖动的效果
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日

posted on 2017-11-30 13:38  阚金翔  阅读(184)  评论(0编辑  收藏  举报