winform窗体抖动效果
程序员文章站
2022-06-08 17:34:30
...
C# 窗体抖动
public void ShawForm()
{
Random ran = new Random((int)DateTime.Now.Ticks);
Point point = this.Location;
for (int i = 0; i < 40; i++)
{
this.Location = new Point(point.X + ran.Next(8) - 4, point.Y + ran.Next(8) - 4);
System.Threading.Thread.Sleep(15);
this.Location = point;
System.Threading.Thread.Sleep(15);
}
}