0
我一直用Label控件她是示例代碼使用Label控件創建在C#中的winform循環滾動字幕文本
public partial class FrmMarqueeText : Form
{
private int xPos = 0, YPos = 0;
public FrmMarqueeText()
{
InitializeComponent();
}
private void FrmMarqueeText_Load(object sender, EventArgs e)
{
lblText.Text = "Hello this is marquee text";
xPos = lblText.Location.X;
YPos = lblText.Location.Y;
timer1.Start();
}
private void timer1_Tick(object sender, EventArgs e)
{
if (xPos == 0)
{
this.lblText.Location = new System.Drawing.Point(this.Width, YPos);
xPos = this.Width;
}
else
{
this.lblText.Location = new System.Drawing.Point(xPos, YPos);
xPos -= 2;
}
}
但是當第一次是成品,它沒有繼續工作。請創建滾動字幕文本幫我!
可能重複://stackoverflow.com/questions/5279136/marquee-in-vb-net) – V4Vendetta