I try to switch panels on tabControls on UserControl. Like this
private void button1_Click(object sender, EventArgs e)
{
panel1.Visible=true;
panel2.Visible=false;
.....
panelN.Visible=false;
}
private void button2_Click(object sender, EventArgs e)
{
panel1.Visible=false;
panel2.Visible=true;
.....
panelN.Visible=false;
}
private void buttonN_Click(object sender, EventArgs e)
{
panel1.Visible=false;
panel2.Visible=false;
.....
panelN.Visible=true;
}
but when N exceeds 6, switching panels doesn't work well.
Some panels don't visible ,even if the Button event occurs!
So could you tell me how to switch multi panels.
If possible, could you tell me the smart way to switch panels.
The above code seems to be bad readability.