I have been writing a program with many panels and just today I added a tabControl to help organize things better. I have set the tabControl visibility to false, so the main form is seen first. When buttons are clicked at the top, the respective tab will become visible and the panels will be seen. I'm using buttons because I don't like the look of tabs at the top.
For tab 1, I have placed 17 panels, all on top of each other. While adding them to tab 1, I added them starting with the newest panel (panel 17) to the oldest panel (panel 1). I set panel 1 visibility to true and the remaining panels (2-17) to false. I can see the panels on tab 1, starting with panel 1, clear as day, but when I run the program it is no where to be seen and the other tabs (tabs 2-6) work as expected. Here's my button_click event for tab 1.
private void btnBusinessPlan_Click(object sender, EventArgs e)
{
tabControl1.Visible = true;
tabPage1.Show();
tabPage2.SendToBack();
tabPage3.SendToBack();
tabPage4.SendToBack();
tabPage5.SendToBack();
tabPage6.SendToBack();
panel17.Visible = false;
panel16.Visible = false;
panel15.Visible = false;
panel14.Visible = false;
panel13.Visible = false;
panel12.Visible = false;
panel11.Visible = false;
panel10.Visible = false;
panel9.Visible = false;
panel8.Visible = false;
panel7.Visible = false;
panel6.Visible = false;
panel5.Visible = false;
panel4.Visible = false;
panel3.Visible = false;
panel2.Visible = false;
panel1.Visible = true;
}
I have even changed the order of the panels, from ascending to descending, in case that worked. Still nothing.