1

I'm looking for a Windows Forms tool in Visual Studio (C#) that acts like a panel, but can have a number of preset configurations of controls that can be switched between via code. The user can't change the configuration himself. Does this exist?

My thought was a TabControl, where the upper tabs are initially set to invisible upon startup, but I can switch between them in the Designer and systematically switch tab in C# code. Is there a more elegant solution?

david
  • 292
  • 5
  • 20
  • You can switch between panels... http://stackoverflow.com/questions/6254308/windows-forms-switch-between-panels – m1o2 Jun 29 '14 at 18:50
  • What is the problem with the TabControl with [invisible headers](http://stackoverflow.com/questions/10316567/how-do-i-create-a-tab-control-with-no-tab-header-in-windows-form)? Users won't be able to change the control set and you can change the tab from code-behind. Well, you obviously should be able to access them in the designer - you are protecting users from unneeded data, not complicating your own design activities. – Eugene Podskal Jun 29 '14 at 18:53
  • @m102 But the panels will have to be on top of each other in the designer, how am I supposed to edit the controls in the panel below easily? – david Jun 29 '14 at 19:06
  • 1
    You can store the `Panels` on the `TabPages` of an __invisible__ `Tab` and then `Add` them to the `Form's Controls` when you need them and `Remove` them when switching. This way you can design them (almost) perfectly and still keep their state while switching as they still are stored in the `Tab`.. Works like a charm, even without magic. – TaW Jun 29 '14 at 19:29

0 Answers0