WinForm UI在同一表单上的不同视图 [英] WinForm UI different views on the same form

查看:91
本文介绍了WinForm UI在同一表单上的不同视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我不是UI设计方面经验丰富的人。所以我只想在这里发布我的问题。



在同一表格上的Win Form(C#)UI应用程序中,我需要看到不同的视图。首先说我有一个登录屏幕。登录后用户可以看到不同的视图。点击不同的控件显示不同的视图。



我可以使用面板。或者我只是用显示/隐藏控件来做。



提前感谢所有评论。

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.

推荐答案

你可以使用面板 - 并显示/隐藏相关的面板。

或者你可以创建一些UserControls,每个都有整个视图设计。然后,您可以显示/隐藏UserControl,也可以从Form.Controls集合中添加和删除它。这在设计师中更容易玩,因为当您添加,移除和移动控件时,您可以轻松地看到整个视图 - 面板和单个控件往往会妨碍彼此并且可以使它成为可能令人沮丧的体验。



但通常对于登录表单,您将有单独的表单:在主表单构造函数中显示您的登录屏幕(使用ShowDialog)然后关闭应用程序或继续显示您的实际表单,具体取决于用户登录信息。
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.


是的,您可以。为什么不?请参阅: https:// msdn .microsoft.com / zh-CN / library / system.windows.forms.control.visible%28v = vs.110%29.aspx [ ^ ]。



有什么问题?您可以通过多种不同方式操纵视图和可见性。无论你想展示什么,它都可以实现。设计好的可用UI设计更为重要。



让我告诉你:通过编写小型原型项目和实验来解决这些问题。执行此操作时,请仔细阅读文档。认为。模拟用户的感知和可能的行为。实验。



-SA
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


这篇关于WinForm UI在同一表单上的不同视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆