Click here to Skip to main content
15,889,335 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi all,

I'm not an experienced person on UI design. So I just thought to post my question here.

On a Win Form (C#) UI application on the same form I need to see different views. Say first I've a login screen. After the login user can see a different view. On that clicking different controls display the different views.

Can I use panels for that. Or simply I've to do it with show/hide controls.

Thanks in advance for all the comments.
Posted
Comments
Sergey Alexandrovich Kryukov 6-Jun-15 1:58am    
What have you tried so far?
—SA

You can use panels for that - and show/hide the relevant panels.
Or you could create a number of UserControls, each with the whole view design. You then either show/Hide the UserControl or add and remove it from the Form.Controls collection. This is a lot easier to "play with" in the designer, as you can easily see the whole view when you are adding, removing, and moving controls - panels and individual controls tend to get in the way of each other and can make it a frustrating experience.

But normally for a login form, you would have separate forms: display your Login screen (using ShowDialog) in the main form constructor and then either close the application or continue with your actual form display depending on the user login info.
 
Share this answer
 
Yes, you can. Why not? Please see: https://msdn.microsoft.com/en-us/library/system.windows.forms.control.visible%28v=vs.110%29.aspx[^].

What's the problem? You can manipulate the view and visibility in many different ways. No matter what you want to show, it can be implemented. It's more important to devise good usable UI design.

Let me tell you: such problems are solved by writing small prototype project and experimenting. When you do it, thoroughly read the documentation. Think. Model the user's perception and possible behavior. Experiment.

—SA
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900