Hi all,
I'm writing a simple application in C# but I'm having an annoying ArgumentOutOfRangeException thrown by Invoke() saying "Text length must be less than 64 characters long.".
Is this usual that strings passed through delegates have to be shorter than 64 characters? What's the usual neat way around it? Do I have to box it in some container class?
The code is here:
public enum StatusIcons { NoChange, Idle, Download, Fail, Reply, ShuttingDown, Pause } ;
public void updateStatus(string description, StatusIcons icon = StatusIcons.NoChange, string tooltip = null)
{
if (this.InvokeRequired)
{
System.Diagnostics.Debug.Print("invoke {0},{1}: \r\n{2}\r\n{3}", description.Length, tooltip!= null ? tooltip.Length : 0, description, tooltip);
this.Invoke(new Action<string,StatusIcons,string>(updateStatus), description, icon, tooltip);
}
else
{
if (description != null)
{
tsStatus.Text = description;
notify.Text = description;
}
if (icon != StatusIcons.NoChange)
notify.Icon = getIcon(icon);
if (tooltip != null)
{
notify.BalloonTipText = tooltip;
notify.ShowBalloonTip(2000);
}
}
}