显示项目的最佳方式,是使用DialogueBox还是UserControl? [英] Best way to show items, whether use DialogueBox or UserControl?

查看:58
本文介绍了显示项目的最佳方式,是使用DialogueBox还是UserControl?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一个带有3个不同按钮的表单.单击此按钮必须打开不同的表单.

最好的方法是,对于每个按钮使用3个表单,还是我们可以有一个通用表单,并使用用户控件来适应每次点击?

谢谢,
Skunkhead:)

HI guys,

I''m having a form with 3 different buttons. This buttons must open different forms on click.

What will be the best way, whether to use 3 forms for each buttons or we can have a common form and use the user-control to fit in on each click?

Thanks,
Skunkhead :)

推荐答案

我认为这取决于您的要求,例如您是否会为每种表单显示相同的内容,那么 User Control 是最好的其他不同的表单.
I think its depend on your requirement like if you would be display same thing for each forms then User Control is best else Different Forms.


这取决于表单的功能:如果它们都在做类似的事情(例如,查找不同人员的详细信息),则相同的形式很有意义.
如果他们做的事情不同(例如,一个人查看人们的工作经历,另一个编辑当前的地址和联系方式),则格式会不同. 通常,如果需要提出问题,则需要不同的形式:如果数据是分开的,则将它们分开.想想看:如果一个窗体只有一个TextBox和两个按钮,您是否希望它与包含十个TextBox,两个下拉列表和一个DataGridView的窗体共享相同的屏幕空间?
It depends on what the forms are doing: if they are all doing similar things (say, looking a details of different people) then the same form makes sense.
If they are doing different things (say, one looks at peoples employment history, another edits current address and contact details) then different forms.
Generally, if you have to ask the question, you need different forms: keep them separate if the data is separate. Think about it: If one form has only 1 TextBox and two buttons, do you want it sharing the same screen real estate as a form containing ten TextBoxes, two drop down lists, and a DataGridView?


许多形式肯定不好.

如果可以的话,以一种形式使用所有内容.是否为UserControl-无关紧要;您可以使用不同的技术进行不同的设计.现在,我们在谈论设计.假设您可以使用3个重叠的面板;在按钮上单击显示一个(按哪个按钮区分),然后隐藏两个.另外,请使用:选项卡界面,扩展面板,可停靠界面,由列表或树选择控制的主/明细等.最重要的是:不要使用MDI.

—SA
Many forms are certainly bad.

Use all in one form if you can. Is it UserControl or not — does not matter; you can do different designs with different techniques. Now, we''re talking designs. You can use, let''s say, 3 overlapping panels; on button click show one (discriminated by which button is pressed) and hide two. Also, use: tab interfaces, expanding panels, dockable interfaces, master/detail controlled by list or tree selection, etc. Most important: don''t use MDI.

—SA


这篇关于显示项目的最佳方式,是使用DialogueBox还是UserControl?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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