C#应用案例之窗体抖动

抖动轨迹

在这里插入图片描述

线程实现抖动

             for (int i = 0; i < 11; i++)
               {
                this.Location = new Point(this.Left + 10, this.Top);
                Thread.Sleep(10);
                this.Location = new Point(this.Left, this.Top + 10);
                Thread.Sleep(10);
                this.Location = new Point(this.Left - 10, this.Top);
                Thread.Sleep(10);
                this.Location = new Point(this.Left - 10, this.Top);
                Thread.Sleep(10);
                this.Location = new Point(this.Left, this.Top - 10);
                Thread.Sleep(10);
                this.Location = new Point(this.Left, this.Top - 10);
                Thread.Sleep(10);
                this.Location = new Point(this.Left + 10, this.Top);
                Thread.Sleep(10);
                this.Location = new Point(this.Left + 10, this.Top);
                Thread.Sleep(10);
                this.Location = new Point(this.Left, this.Top + 10);
                Thread.Sleep(10);
                this.Location = new Point(this.Left - 10, this.Top);
                Thread.Sleep(10);
                }

猜你喜欢

转载自blog.csdn.net/Layfolk_XK/article/details/105603654