0

I want to create an application that has different views. I put my different components in different panels. By clicking on a button, I would like to see the panel that belongs to that button. Is there any other way to navigate between panels besides setting the visibility to false?

Or is there a better way to navigate using other components other than panel?

Dan J
  • 16,319
  • 7
  • 50
  • 82
CMP
  • 435
  • 3
  • 8
  • 22
  • 2
    Winforms? Webforms? Silverlight? Wpf? Mvc? – Eric J. Oct 17 '11 at 17:23
  • In addition to Eric J, this really depends on the user experience you're looking for and what you're trying to achieve on your UI. It's like saying "how should I build my car engine", when we don't know what sort of performance you're looking for. – Stealth Rabbi Oct 17 '11 at 17:24
  • What i actually want to achieve is lets say a large application to fill in application form on my first page i would like to have something like "personal detials" then a button to take u to the next part of the application by going to total new layout – CMP Oct 17 '11 at 17:27

3 Answers3

1

You can use a TabControl.

This allows you to add several TabPages and switch between them by clicking on the tab you want to see.


Update

From your comment it seems you are looking to create a wizard. If so, see these related questions:

Community
  • 1
  • 1
Mark Byers
  • 811,555
  • 193
  • 1,581
  • 1,452
  • Not tabcontrol some cleaner like when u have a button to go next page and it takes u to something different – CMP Oct 17 '11 at 17:25
0

What about displaying only one panel on the main form:

this.Controls.Clear();
this.Controls.Add(this.panel1); //panel2, panel3, ...
anth
  • 1,724
  • 1
  • 19
  • 22
0

It's better to not initialize them all at once: it takes time to build controls and consumes a lot of memory.

Create the panel with controls when requested. Then act as anth suggested.

Ivan Nikitin
  • 3,578
  • 27
  • 39