I have a question, I want to add an array of control to the windows form dynamically, I have prepared the code like following, but the question is only the first controls shows in the form remaining are present in controls collection but not shown on form. What is missing in the code?
Code:
LinkLabel[] arrLbl = new LinkLabel[5];
for (int i = 0; i < 5; i++)
{
LinkLabel lbl = new LinkLabel();
lbl.Text = "Label: " + i.ToString();
arrLbl[i] = lbl;
}
foreach (Control c in arrLbl)
this.Controls.Add(c);