I am having an windows application where I am fetching data from db and binding that to a label. I am using timer and scrolling the label, this works fine when the string is around 150 characters but when I have string of around 30000 characters it just hangs out the application.
lblMsg1.AutoEllipsis = true;
private void timer1_Tick(object sender, EventArgs e)
{
try
{
if (lblMsg1.Right <= 0)
{
lblMsg1.Left = this.Width;
}
else
lblMsg1.Left = lblMsg1.Left - 5;
this.Refresh();
}
catch (Exception ex)
{
}
}
public void bindData()
{
lblMsg.Text = "Some Large text";
}
public void Start()
{
try
{
timer1.Interval = 150;
timer1.Start();
}
catch (Exception ex)
{
Log.WriteException(ex);
}
}
Why is this related to string length and causing application to hang? Thanks in advance.