怎样用c#来编写一个简单的类似QQ的窗体震动···
我是一名刚刚接触C#学生,遇到这个问题,解决不了。望大家可以帮一下···
程序代码: public partial class Form1 : Form
{
int count = 0;
Point plocation = new Point();
public Form1()
{
InitializeComponent();
}
private void timer1_Tick(object sender, EventArgs e)
{
count++;
if (count < 40)
{
switch (count % 4)
{
case 0: this.Location = plocation;
break;
case 1: this.Location = new Point(plocation.X - 3, plocation.Y - 3);
break;
case 2: this.Location = new Point(plocation.X - 6, plocation.Y );
break;
case 3: this.Location = new Point(plocation.X - 3, plocation.Y + 3);
break;
}
}
else
{
this.timer1.Stop();
count = 0;
}
}
private void button1_Click(object sender, EventArgs e)
{
plocation = this.Location;
this.timer1.Start();
}
}
