using System;
using System.Drawing;
using System.Windows.Forms;
namespace twitter
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
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);
}
}
}
}
C#实现窗体抖动
最新推荐文章于 2024-09-14 17:02:52 发布