0

I am overlaying a bunch of panels on top of one another. I want to be able to click a button to display which ever panel is in the stack referred to by unique names (panel1, panel2...).

However, the bottom panel some how is always the parent of whoever is on top of it. Therefore, If I were to set the visibility of the bottom panel to false, then nothing on top of the bottom panel can be made visible.

How do I make these overlayed panels independent to each other instead of having a parent-child relationship?

Fraïssé
  • 168
  • 11

1 Answers1

0

I faced the same situation a time ago. The more pragmatic way that I found was to use a tab control and hide/show tabs accordingly. It is possible to get rid of the label of the tab, so users dont even know about its existence. The rule is to have one and only one tab visible in any given time.

E-Bat
  • 4,792
  • 1
  • 33
  • 58
  • How do you make two tabs visible at any given time? :-) – LarsTech Mar 17 '14 at 20:24
  • @LarsTech No, only one tab will be visible in any given time. When you hit a button you will show the corresponding tab with its panel and hide the others. The adventage of using tab control is that you can work in design view without interferring one panel with other, it can become a messy job. – E-Bat Mar 17 '14 at 20:27
  • Hmm @LarsTech, do not confuse "Visible" with "Active" :P – E-Bat Mar 17 '14 at 20:47
  • I was only making light of your wording since a TabControl can only show one tab at a time. [Creating Wizards for Windows Forms in C#](http://stackoverflow.com/q/2340566/719186) has the code for the tabless TabControl. – LarsTech Mar 17 '14 at 20:50