日期:2014-05-17  浏览次数:20836 次

用C#实现文字的来回滚动?
我想用Lable在我的登陆窗体上把"图书馆"这几个字从左到右滚动!

------解决方案--------------------
C# code
  private void Form1_Load(object sender, EventArgs e)
        {
            System.Windows.Forms.Timer t = new Timer();
            t.Interval = 100;
            t.Tick += new EventHandler(t_Tick);
            t.Enabled = true;
        }

        void t_Tick(object sender, EventArgs e)
        {
            if (this.label1.Right < this.Width)
            {
                this.label1.Left += 10;
                System.Threading.Thread.Sleep(100);
                Application.DoEvents();

            }
            else
            {
                ((Timer)sender).Enabled = false;
            }
        }