Monday, January 9, 2017

How to move label, textbox or any control like (marquee in html) in windows application

1. Take timer control into windows form.
2. Then create timer1_Tick event into .cs file.
3. Write following code within timer1_Tick event.

label.Location = new Point(label.Location.X + 5, label.Location.Y);

            if (label.Location.X > this.Width)
            {
                label.Location = new Point(0 - label.Width, label.Location.Y);
            }

No comments: