Search code examples
c#panels

Multiple Panels in C#


I'm creating a program where there is one form and there are 6 panels. I just want to show the 6 panels in one form. It's like They are top of each other.

When I click the first button, the first panel will show. when I click the second button, the second panel will show and the first panel will hide. so on and so forth.

I use the

panel1.Visible = true/False; Method.

but when i Clicked the second button, the panel2 are not shown in the form. thank you in advance!


Solution

  • panel1.BringToFront(); 
    

    this will get the panel1 on top of all the other panels.