1. 01 private void myMethod_QQShake()    
  2.  
  3. 02 {    
  4.  
  5. 03     //将此方法,假如窗体的 Shown 事件中即可。    
  6.  
  7. 04     //using System.Threading    
  8.  
  9. 05      
  10.  
  11. 06     Point point = this.Location;    
  12.  
  13. 07     for ( int i = 0 ; i <= 6 ; i++ )    
  14.  
  15. 08     {    
  16.  
  17. 09         //*(new Random()).NextDouble()随机数值    
  18.  
  19. 10         this.Top = ( int ) ( point.Y + 5 * Math.Pow ( -1 , i ) );//上下震动5像素    
  20.  
  21. 11         this.Left = ( int ) ( point.X + 5 * Math.Pow ( -1 , i ) );//左右震动 5像素    
  22.  
  23. 12      
  24.  
  25. 13      
  26.  
  27. 14         Thread.Sleep ( 25 );    
  28.  
  29. 15     }    
  30.  
  31. 16     this.Location = point;    
  32.  
  33. 17 }   

来自:http://yuncode.net/code/c_5088cbfb97dc446