When making a label scroll, when the information is to large, I get a StackOverflow Exception.
Code in question:
If anyone knows of a fix, please answer below.
private async Task LblScroll(int time)
{
lblScroll.Location = new Point(lblScroll.Location.X - 5, lblScroll.Location.Y);
if (lblScroll.Location.X < (-lblScroll.Width))
{
if (stopScroll)
return;
else
lblScroll.Location = new Point(this.ClientSize.Width + lblScroll.Text.Length, lblScroll.Location.Y);
}
if (!stopScroll)
{
await Task.Delay(time);
await LblScroll(time);
}
else
return;
}