Im using a Label where text input from a text box is shown in that label. Now, I whant to make the label text scroll. I´ve looked around through the internet and I tried to write this into the code inside of the label:
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;
}
Does anybody see what Im doing wrong?
//much easier:
private void timer2scroll_Tick(object sender, EventArgs e)
{
label10Info.Text = label10Info.Text.Substring(1, label10Info.Text.Length - 1) + label10Info.Text.Substring(0,1);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With