public partial class frmFlow : Form { string FineString = " "; PointF thispoint; Font thisFont = new Font("Times New Roman", 100); SolidBrush thisbrush = new SolidBrush(Color.Red); public frmFlow() { InitializeComponent(); } private void frmFlow_Load(object sender, EventArgs e) { SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.DoubleBuffer, true); SetStyle(ControlStyles.ResizeRedraw, true); timer1.Start(); } SizeF size = new SizeF(); RectangleF rc = new RectangleF(); private void timer1_Tick(object sender, EventArgs e) { FineString = "(-: Smile :-)"; timer1.Interval = 33; //(int)nudSpeed.Value; ; Invalidate(); } protected PointF getPoint() { thispoint.X -= 5;//(int)nudDistance.Value; if (thispoint.X <= 0 - size.Width) { thispoint.X = this.Width; } thispoint.Y = 180; return thispoint; } private void frmFlow_Paint(object sender, PaintEventArgs e) { size = e.Graphics.MeasureString(FineString, thisFont); e.Graphics.DrawString(FineString, thisFont, thisbrush, getPoint()); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)