Hey guys, i want to add LinkLabels dynamically into a panel. But my code only returns me one linklabel in the panel. The rest of the linklabels doesn't appear. Can you tell me why?
Code:foreach(FileInfo file in directory.GetFiles()) { if( file.Extension == ".html" ) { LinkLabel = new LinkLabel(); LinkLabel.Name = file.Name.Remove(file.Name.Length-5,5); LinkLabel.Text = file.Name.Remove(file.Name.Length-5,5); LinkLabel.Location = new Point(x, y); LinkLabel.Size = new Size(220, 40); LinkLabel.Visible = true; Panel.Controls.Add(LinkLabel); y += 10; } // close if } // close foreach




Reply With Quote