Best Way to have different views base don menu selection?

  • Thread starter Thread starter mBird
  • Start date Start date
M

mBird

C#, Windows forms, basic form and a menu.
I want to display different sets of controls based on the menu choice (so I
want to have different pages of questions based on a user selected menu
choice -- so if I choose A I want to show a label and three textboxes but if
I choose B I want to show a different label and five textboxes).

Like having tabs but instead of a tab I have my menu choice change the
form's appearance and the controls it uses.

I could just do x.Show and x.Hide for all the controls but is there a better
way to do it?

Also there will be a button and some other labels that I would like in
common no matter what menu is selected.

Thanks for any ideas.
 
* "mBird said:
C#, Windows forms, basic form and a menu.
I want to display different sets of controls based on the menu choice (so I
want to have different pages of questions based on a user selected menu
choice -- so if I choose A I want to show a label and three textboxes but if
I choose B I want to show a different label and five textboxes).

Like having tabs but instead of a tab I have my menu choice change the
form's appearance and the controls it uses.

I could just do x.Show and x.Hide for all the controls but is there a better
way to do it?

Also there will be a button and some other labels that I would like in
common no matter what menu is selected.

You can design different usercontrols which contain the views of the
form. Then you can place these usercontrols on the form and show/hide
or add/remove them.
 
You could put the different sets of controls on separate panels, and the
hide and show the panels. This would simulate a tab control, without the
tabs.
 
Back
Top