日期:2014-05-18  浏览次数:20948 次

控件滚动问题
求C#的滚动代码,以标签为例,主要是怎样让标签滚到左边时回到窗体的右边

------解决方案--------------------
试试这样:

private void button1_Click(object sender, EventArgs e)
{
Timer timer = new Timer();
timer.Interval = 30;
timer.Tick += new EventHandler(timer_Tick);
timer.Start();
}

void timer_Tick(object sender, EventArgs e)
{
if (this.label1.Right <= this.ClientRectangle.X)
{
this.label1.Left = this.ClientRectangle.Right;
}
else
{
this.label1.Left--;
}
}