I have 2 panels. Each start at the same location.(Let’s say 10,10) and have the same size.
I have 2 buttons. One shows the first panel and the other shows the second panel.
My code is:
private void button1_Click(object sender, EventArgs e)
{
panel1.Visible = true;
panel2.Visible = false;
}
private void button2_Click(object sender, EventArgs e)
{
panel1.Visible = false;
panel2.Visible = true;
}
When I press button one the the first panel shows up, but when click button 2 the second panel doesn’t show up. The panel’s visible properties are initially false..
What is wrong?
Make sure that Panel2 is not a child window of Panel1.