Using System;
Using System. collections. generic; using System. componentModel; using System. data; using System. drawing; using System. linq; using System. text; using System. windows. forms; namespace WindowsFormsApplication1 {public partial class Form1: Form {public Form1 () {InitializeComponent ();} private Label label = new Label (); public string text = "csdn baihe_591 "; private void Form1_Load (object sender, Eve NtArgs e) {this. label. location = new Point (149, 13); this. label. size = new Size (134, 16); this. controls. add (label); this. label. text = ""; this. timer1.Enabled = true; this. timer1.Interval = 500; p = new PointF (this. label. size. width, 0);} PointF p; Font f = new Font ("", 10); Color c = Color. white; string temp; private void timereffectick (object sender, EventArgs e) {Graphics g = this. label. createG Raphics (); SizeF s = new SizeF (); s = g. measureString (text, f); // measure the text length. Brush = Brushes. black; g. clear (c); // Clear the background if (temp! = Text) // re-display {p = new PointF (this. label. size. width, 0); temp = text;} else p = new PointF (p. x-10, 0); // 10 if (p. X <=-s. width) p = new PointF (this. label. size. width, 0); g. drawString (text, f, brush, p );}}}