闪屏

在聊天室中经常要使用闪屏,这里提供一个产生闪屏的方法
View Code
 private void ShakeWindow()
        {
            Random ran = new Random();
            System.Drawing.Point point = this.Location;
            for (int i = 0; i < 30; i++)
            {
                this.Location = new System.Drawing.Point(point.X + ran.Next(8), point.Y + ran.Next(8));
                System.Threading.Thread.Sleep(15);
                this.Location = point;
                System.Threading.Thread.Sleep(15);
            }
        }
posted @ 2012-09-22 23:38  NoDelay  阅读(181)  评论(0)    收藏  举报