private void button2_Click(object sender, EventArgs e)
{
int recordx = this.Left;
int recordy = this.Top;
Random random = new Random();
for (int i = 0; i < 50; 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(1);
}
this.Left = recordx;
this.Top = recordy;
}
制作抖动窗体
最新推荐文章于 2019-09-02 15:04:00 发布