在C#中timer的使用
在c#中,我想用一个timer控制一个Label,a,b,c分别是三个Label对象,代码如下:
private void button1_Click(object sender, EventArgs e)
{
this.timer1.Interval = 10;
this.timer1.Start();
}
private void timer1_Tick(object sender, EventArgs e)
{
this.a.Top += 1;
this.b.Top += 2;
this.c.Top += 3;
if (this.a.Top == this.Size.Height)
{
this.a.Top = this.menuStrip1.Size.Height;
}
if (this.b.Top == this.Size.Height)
{
this.b.Top = this.menuStrip1.Size.Height;
}
if (this.c.Top == this.Size.Height)
{
this.c.Top =this.menuStrip1.Size.Height;
}
}
为什么 this.c.Top += 3;这样设置C 之后,C出现一次以后就不出现了呢?而且设置成3或3的倍数都不行,why?