Hi
i get the System.NullReferenceException error with this code at line txt[i].Text = i.ToString();
Thanks
private void button1_Click(object sender, EventArgs e)
{
TextBox[] txt = new TextBox[5];
for (int i = 0; i < 5; i++)
{
txt[i].Text = i.ToString();
}
}

Valerie MeunierRank #1,527 · 1K reputationPosted Jan 2, 2022, 5:50 AM EST