I have this Method that Generates a Panel on the form:
private void createPanels(int spacing)
{
pnl1.Location = new Point(0, spacing);
pnl1.BorderStyle = BorderStyle.FixedSingle;
pnl1.Size = new Size(100, 93);
tabRotaBuild.Controls.Add( pnl1);
}
I then call this method in form load:
private void Form1_Load(object sender, EventArgs e)
{
createPanels(60);
}
What I want to do next is display this panel again (a new panel) under it with out clearing the existing one. I have a button that generates the new panel when clicked but when I click it the existing panel disappears when the new one is displayed.
This is the code behind the button:
int s = 0;
private void button1_Click(object sender, EventArgs e)
{
s += 100;
createPanels(s);
}
TabPage, try adding it to aFlowLayoutcontrol.