C#窗口抖动···?
来源:百度知道 编辑:UC知道 时间:2024/09/12 22:16:12
bleachcool@163.com
public void douDong()
{
int recordx = this.Left;
int recordy = this.Top;
Random random = new Random();
for (int i = 0; i < 15; i++)
{
int x = random.Next(10);
int y = random.Next(10);
if (x % 2 == 0)
{
this.Left = this.Left + x;
}
else
{
this.Left = this.Left - x;
}
if (y % 2 == 0)
{
this.Top = this.Top + y;
}
else
{
this.Top = this.Top - y;
}
System.Threading.Thread.Sleep(44);
}
this.Left = recordx;
this.Top = recordy;