日期:2014-05-18 浏览次数:20900 次
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); } } } }