小编Jes*_*pez的帖子

标签滚动效果

我使用一个标签,其中从文本框中输入的文本显示在该标签中。现在,我想让标签文本滚动。我通过互联网环顾四周,并尝试将其写入标签内的代码中:

private void label1_Click(object sender, EventArgs e)
{
    int Scroll;
    string strString = "This is scrollable text...This is scrollable text...This is scrollable text";

    Scroll = Scroll + 1;
    int iLmt = strString.Length - Scroll;
    if (iLmt < 20)
    {
        Scroll = 0;
    }
    string str = strString.Substring(Scroll, 20);
    label1.Text = str;
}
Run Code Online (Sandbox Code Playgroud)

有没有人看到我做错了什么?

c# label scroll winforms

4
推荐指数
1
解决办法
2万
查看次数

标签 统计

c# ×1

label ×1

scroll ×1

winforms ×1