C#窗口抖动···?

来源:百度知道 编辑:UC知道 时间:2024/06/24 11:01:59
VS2008下成功,VS2005下总提示出错很纳闷麻烦大家贴一下代码,能把程序发我邮箱更好,窗口抖动的源程序谢谢
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;