S
Steven C
Hello:
I'm trying to dynamically generate some labels for a form, and I can't
seem to get it to work. The code is as follows. The first label is
generated, but subsequent labels are not. Is there a better technique
for this
for(int i=0; i <= intLabCount; i++)
{
strArrLabAccounts = "lblCaption" + Convert.ToString(i).Trim();
Label lblNewLabel = new Label();
lblNewLabel.Parent = this.pgLiveView;
lblNewLabel.Text = "Yahoo" + Convert.ToString(i);
lblNewLabel.Location = new System.Drawing.Point(i*50,20);
lblNewLabel.Visible = true;
lblNewLabel.Name = strArrLabAccounts.ToString();
}
I'm trying to dynamically generate some labels for a form, and I can't
seem to get it to work. The code is as follows. The first label is
generated, but subsequent labels are not. Is there a better technique
for this
for(int i=0; i <= intLabCount; i++)
{
strArrLabAccounts = "lblCaption" + Convert.ToString(i).Trim();
Label lblNewLabel = new Label();
lblNewLabel.Parent = this.pgLiveView;
lblNewLabel.Text = "Yahoo" + Convert.ToString(i);
lblNewLabel.Location = new System.Drawing.Point(i*50,20);
lblNewLabel.Visible = true;
lblNewLabel.Name = strArrLabAccounts.ToString();
}