窗體抖動

//實現窗體抖動的效果
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日

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章