首页 > 解决方案 > 如何修复“在 C# 中用一些空间连续移动文本(标签)”?

问题描述

我有一些用于移动文本的 c# 代码,例如 HTML 中的选框标记。我想在不消失的情况下将第二个文本移到第一个文本之后。

string[] ss;
int index = 0;        

private void timer1_Tick(object sender, EventArgs e)
{
    if (clsBas.SCREEN_TEXT != "") //multiline text
    {
        lblScreenText.Text = ss[index];

        if (lblScreenText.Left < 0 && (Math.Abs(lblScreenText.Left) > lblScreenText.Width))
        {
            lblScreenText.Left = 1920;//panel width 
            index++;    
        }

        lblScreenText.Left = lblScreenText.Left - 15;

        if (index == ss.Length)
        {
            index = 0;
        }
    }
}

标签: c#marquee

解决方案


推荐阅读