我正在使用此代码以制作从右向左滚动的选取框标签。这个选取框代码为什么不起作用?
private int xPos = 651;
private void timer1_Tick(object sender, EventArgs e)
{
if (this.Width == xPos)
{
//repeat marquee
xPos = 651;
this.Label7.Location = new System.Drawing.Point(651, 334);
xPos--;
}
else
{
this.Label7.Location = new System.Drawing.Point(xPos, 334);
xPos--;
}
}
651是窗体的宽度。
此代码使标签从右向左移动,滚动窗体应该像它一样,但不会再次在右侧重新启动。
双击标题:) – RedFilter 2012-08-09 18:00:43
负只是出于好奇:为什么不这样做字幕上使用jQuery或普通的JavaScript客户端? – Dimitri 2012-08-09 18:01:22
@Dimitri,我认为这是winform,我做了太多的webform :-p – Fredou 2012-08-09 18:01:53