表单中的单选按钮太多 [英] Too many radio buttons in the form

查看:68
本文介绍了表单中的单选按钮太多的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在vb.net上编写一个程序,其中有大量的单选按钮,因为该系统是一个客户满意度系统,必须输入客户的答案.因此,我应该在每个单选按钮上进行if语句查看是否是检查还是有其他方法,因为如果我为每个单选按钮写了if语句,那么这将花费很多时间?

预先感谢.

Hi all ,

i am making a program in vb.net where i have a big number of radio buttons since the system is a customer satisfaction system where i must enter the answers of the customer.So should i make if statements on every radio button to see if it is checked or is there any other way since if i wrote if statements for every radio button then this will take a lot of time ?

Thanks in advance.

推荐答案

好吧,您不必为每个单选按钮编写IF语句.您可以将相关的单选按钮组合在一起,处理Click或CheckChanged事件,并相应地处理更改.一个事件处理程序可以处理多个readio按钮.您可以在用户进行更改时而不是在用户单击确定"将其全部提交时修改后备值.
Well, you don''t have to write IF statements for every radio button. You could just group related radios together, handle the Click or CheckChanged events and handle the changes accordingly. A single event handler can handle multiple readio buttons. You can modify your backing values when the user makes the changes instead of when the user clicks OK to submit them all.


Dave是正确的.

此外,太多的单选按钮表示UI设计不良.您可以使用下拉菜单ComboBox代替一组单选按钮,也可以将表单细分为较小的容器(例如标签),以一次显示较少的控件.如果用户一次看到许多控件,则已经不是管理人员了.您还应该考虑用户的便利性,而不仅仅是您自己的.

我的建议是我之前列出的关于UI设计的少数建议之一.请查看我对这个问题的回答:
GUI外观-C#.Net [
Dave is right.

Additionally, too many radio buttons is indicative of a bad UI design. You could use drop-down ComboBox instead of a set of radio buttons, or subdivide you form in smaller containers (such as tabs) to show less controls at a time. If the user see to many controls at a time, it''s already not management. You should think about user''s convenience as well, not just about your own.

This my advice is one of the few advices on UI design I listed before. Please see my answer to this question:
GUI Apperance - C#.Net[^].

—SA


这篇关于表单中的单选按钮太多的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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