private Label label = new Label();
public string text ="材稲薄狹タΑ秨Α";
private void main_Load(object sender, EventArgs e)
{
this.timer1.Start();
SubWindow vSubWindow = new SubWindow();
vSubWindow.AssignHandle(panel1.Handle);
skinEngine1.SkinFile = Application.StartupPath + @"\OneGreen.ssk";
this.label.Location = new Point(280, 13);
this.label.Size = new Size(149, 26);
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("Ш蔨", 18);
Color c = Color.Red;
string temp;
private void timer1_Tick(object sender, EventArgs e)
{
Graphics g = this.label.CreateGraphics();
SizeF s = new SizeF();
s = g.MeasureString(text, f);
Brush brush = Brushes.Black;
g.Clear(c);
if (temp != text)
{
p = new PointF(this.label.Size.Width, 0);
temp = text;
}
else
p = new PointF(p.X - 10, 0);
if (p.X <= -s.Width)
p = new PointF(this.label.Size.Width, 0);
g.DrawString(text, f, brush, p);
}
c#屏幕字滚动
原创
©著作权归作者所有:来自51CTO博客作者gaowu2012的原创作品,如需转载,请与作者联系,否则将追究法律责任
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
C#的WebBrowser自动滚动
C#使WebBrowser自动滚动,需要加一个定时控件Timer。这样就完成了滚动条自动滚动的问题。
前端 c# java 自动滚动 控件