Aug 17, 2011

Moving a label like Marquee Sliding Text or Continuous scrolling text in Visual C Sharp(C#)?

A very simple scrolling text in your visual c sharp form.

Just add a Timer from your ToolBox,
in the Form Design mode, double click the Timer.
Insert the code as shown below into your Timer_tick(you can see it, after your double click):

        private void timer1_Tick(object sender, EventArgs e)
        {
            if(label1.Right > 0)
                label1.Left = label1.Left - 5;
            else if(label1.Right <= 0)
            {
                label1.Left = 107;
               
            }
            label2.Text = label1.Width.ToString();
            label3.Text = label1.Right.ToString();
        }