private void myMethod_QQShake()
{
//将此方法,假如窗体的 Shown 事件中即可。
//using System.Threading

Point point
= this.Location;
for ( int i = 0 ; i <= 6 ; i++ )
{
//*(new Random()).NextDouble()随机数值
this.Top = (int)( point.Y + 5 * Math.Pow(-1 , i) );//上下震动5像素
this.Left = (int)( point.X + 5 * Math.Pow(-1 , i) );//左右震动 5像素


Thread.Sleep(
25);
}
this.Location = point;
}

 

 

 

相关文章:

  • 2021-11-15
  • 2021-07-22
  • 2021-08-26
  • 2022-01-31
  • 2021-06-28
  • 2022-02-04
  • 2021-08-25
猜你喜欢
  • 2021-05-20
  • 2022-01-01
  • 2021-07-16
相关资源
相似解决方案