Issues to be aware of when using panel in WinForm:
When several panel sizes are the same, you should be aware of the same position
Is there a problem with overlapping between the panel, in general (when overlapping):
private void Toolstripmenuitem1_click (object sender, EventArgs e)
{
Panel1. Visible = false;
Groupbox1.visible = true;
Panel2. Visible = False
}
private void Toolstripmenuitem2_click (object sender, EventArgs e)
{
Panel1. Visible = true;
Groupbox1.visible = false;
Panel2. Visible = false;
}
private void Toolstripmenuitem3_click (object sender, EventArgs e)
{
Panel2. Visible = true;
Panel1. Visible = false;
Groupbox1.visible = false;
}
That is, as soon as you open the target panel and then close the other, but if you put the panel in the same position and size, you might be able to place the panel that was later placed on the front panel, And when you open Panel2 or Groubox in the back, you close the panel where it was, so it's impossible to see the results you want to see;
That is, you must first identify the panel you want to open before closing the panel.
Such as
private void Toolstripmenuitem1_click (object sender, EventArgs e)
{
Panel1. Visible = false;
Groupbox1.visible = true;
}
private void Toolstripmenuitem2_click (object sender, EventArgs e)
{
Panel1 in groupbox1s so can not close the GroupBox
Panel1. Visible = true;
Groupbox1.visible = false;
Panel2. Visible = false;
}
private void Toolstripmenuitem3_click (object sender, EventArgs e)
{
Panel2 in panel1.so
Panel2. Visible = true;
}
Three panel together