I know there are lots of threads regarding this error, but I've genuinely tried my best to understand the solution and can't seem to manage to get this to work.

I've written a simple test program that gives the error (code below). I should point out that for the actual program I want to create large numbers of labels, and the number varies at run time, so I can't just create them manually in the code.

Any help would be much appreciated.

```
namespace Test
{
    public partial class Form1 : Form
    {

        Label[] label = new Label[3];

        public Form1()
        {
            InitializeComponent();              
        }

        private void button1_Click(object sender, EventArgs e)
        {            
           for (int i = 0; i < 3; i++)
           {
              label[i].Location = new Point(10, 10 + 40*i);
              label[i].Text = "My name is label " +i;
              this.Controls.Add(label[i]);                
           }
           MessageBox.Show("Done");   
        }
    }
}

```