I want to add one of panel1,2,... into panel0 when I click on button1 .
It's my code
private void button3_Click(object sender, EventArgs e)
{
int i = 0;
int j = 0;
Panel[] pnl = new Panel[3];
while ( i<2)
{
pnl[i].Parent = panel0; // erorr
pnl[i].BackColor = Color.PeachPuff;
pnl[i].Size = new Size(50, 10);
pnl[i].Location = new Point(j+5,10);
panel0.Controls.Add(pnl[i]);
pnl[i].BringToFront();
i++;
j = j + 13;
}
}
Have a suggestion ?