C# 实现窗体抖动
http://blog.csdn.net/jianuMan/archive/2010/06/18/5678912.aspx
QQ有窗体抖动的功能 其实这个功能实现起来很简单。间隔一定时间,改变窗体的位置,必须是围绕起始位置改变窗体位置,否则就成窗体移动了。
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); } } }}