so what i am trying to do is on button_Click to copy all Controls from (template)panel into a new panel. Here's my code:
private void button6_Click(object sender, EventArgs e)
{
Panel myPanel = new Panel();
myPanel.Location = new Point(25, 25);
Control[] controls = new Control[panel1.Controls.Count];
panel1.Controls.CopyTo(controls, 0);
foreach (Control c in controls)
myPanel.Controls.Add(c);
}
But unfortunatelly on button_Click my template Panel just dissapears and i new Panel doesn't appears.
Can some one say me, where in code i have made a mistake ?