R
RodBillett
Is there a limit to themaximum number of links you can add to a linklabel
control? It appears that 32 is the limit, but the error is rather strange.
Its an overflow error that occurs in the main function of th edialog!
It is real easy to reproduce! Create a window with a linklabel control on
it, and perform the following code.
Keep the loop at 31 and everything is OK, change the loop to 32 and you will
get an overflow error! I cant find anything on MSDN about this error.
Thanks
Rod
private void button2_Click(object sender, System.EventArgs e)
{
this.linkLabel1.Text = "";
this.linkLabel1.Links.Clear();
int LinkIndex;
string AddLinkString;
for ( int i = 0; i < 31; i++ )
{
this.linkLabel1.Text += "This is ";
AddLinkString = "area" + i.ToString();
LinkIndex = this.linkLabel1.Text.Length;
this.linkLabel1.Text += AddLinkString;
this.linkLabel1.Links.Add( LinkIndex, (AddLinkString.Length),
"Data" );
this.linkLabel1.Text += " of text ";
}
}
control? It appears that 32 is the limit, but the error is rather strange.
Its an overflow error that occurs in the main function of th edialog!
It is real easy to reproduce! Create a window with a linklabel control on
it, and perform the following code.
Keep the loop at 31 and everything is OK, change the loop to 32 and you will
get an overflow error! I cant find anything on MSDN about this error.
Thanks
Rod
private void button2_Click(object sender, System.EventArgs e)
{
this.linkLabel1.Text = "";
this.linkLabel1.Links.Clear();
int LinkIndex;
string AddLinkString;
for ( int i = 0; i < 31; i++ )
{
this.linkLabel1.Text += "This is ";
AddLinkString = "area" + i.ToString();
LinkIndex = this.linkLabel1.Text.Length;
this.linkLabel1.Text += AddLinkString;
this.linkLabel1.Links.Add( LinkIndex, (AddLinkString.Length),
"Data" );
this.linkLabel1.Text += " of text ";
}
}