使用什么控件

发布于 2024-09-01 08:59:38 字数 302 浏览 2 评论 0原文

我有一个设备列表,需要根据用户选择的选项进行过滤。其中一种选项是冷却:当用户选择冷却时,仅显示具有冷却功能的设备。如果未选择冷却,则显示所有设备(带或不带冷却)。

我想知道我最适合使用哪种控件。我的感觉是复选框不是一个好的控件,因为它代表:

无冷却(未选中)/仅冷却 (已勾选)

当我想要的时候

冷却和不冷却(未选中)/ 仅冷却(选中)。

这里最好使用什么控件?

谢谢。

I have a list of devices that I need to filter on according to options selected by the user. One such option is cooling: when the user selects cooling only the devices with cooling are shown. If cooling is not selected then all devices (with or without cooling) are shown.

I wonder what kind of control I best use for this. My feeling is thata checkbox is not a good control since it represents:

No cooling (unchecked) / only cooling
(checked)

while I want

cooling and no cooling (unchecked)/
only cooling (checked).

What control is best used here?

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

赢得她心 2024-09-08 08:59:38

我看到三个选项,按优先级递减的顺序排列:

  • 使用三态复选框(可以变灰的一个),使用 ThreeState 属性。这里的主要优点是更少的混乱、更少的阅读和更少的点击。如果它们一开始是灰色的,用户会清楚这种状态是可能的,并且与通常的复选框行为的偏差应该不是什么大问题。

  • 使用带有“是”、“否”和“不关心”选项的下拉列表。如果部分或全部选项最初明确为“是”或“否”,这可能是更好的选择。

  • 使用三列单选按钮网格。丑陋,需要一些思考才能理解它。我不会这样做。

I see three options, in order of decreasing preference:

  • Use a tristate checkbox (one that can be grayed), using the ThreeState property. The main advantage here is less clutter, less reading, and less clicks. If they are on gray at the beginning, it will be clear to the user that this state is possible and the deviation from usual checkbox behaviour should not be much of a problem.

  • Use a drop-down list with options "Yes", "No" and "Don't care". If some or all of the options are going to be a definite "Yes" or "No" initially, this might be the better option.

  • Use a grid of radio buttons with three columns. Ugly, and requires some thought to understand it. I would not do this.

⒈起吃苦の倖褔 2024-09-08 08:59:38

不要忘记,.NET 复选框类可以设置为具有三种状态

CheckBox.ThreeState = TRUE;

edit 这为您提供了 CheckBox.Checked 的 true 或 false 以及 CheckBox.Checked 的已选中、未选中或不确定状态 edit代码>CheckBox.CheckState。

Don't forget that a .NET checkbox class can be set to have three states

CheckBox.ThreeState = TRUE;

edit This gives you true or false for CheckBox.Checked and checked, unchecked or indeterminate for CheckBox.CheckState.

宁愿没拥抱 2024-09-08 08:59:38

复选框是正确的控件。您只需正确标记它:“仅包括设备:[ ] 带冷却。”对我来说,取消选中意味着不应用过滤器并包括带冷却和不带冷却的设备,这一点似乎很明确。一般来说,用户将空白(包括未选中的空白)解释为“不按此条件查询/过滤”,而不是“反转此查询过滤条件”。

如果您不相信,请使用单选按钮(如果空间紧张,则使用下拉列表):“仅包括设备:( ) 带冷却,( ) 带或不带冷却。”

如果您想要包含过滤“不带冷却”的选项,则必须使用单选按钮或下拉列表:“仅包含设备:( ) 带冷却,( ) 无冷却。”同样,如果您需要显示两种以上的状态,则必须使用单选按钮或下拉列表:“仅包括设备:( ) 有冷却,( ) 无冷却,
( ) 有或没有冷却。”

您是正确的,使用三态复选框会令人困惑。混合状态用于表示“有些是,有些否”,而不是“既是又否”。 Windows UX 交互指南明确禁止使用复选框的混合状态作为单个项目的第三种状态(在本例中为筛选),或让用户选择混合状态 (pg49)。

一般来说应该避免。

The checkbox is the correct control. You just have to label it correctly: “Include only devices: [ ] With cooling.” That seems unambiguous to me that uncheck means apply no filter and include both devices with and without cooling. In general, users interpret a blank, including unchecked, as “don’t query/filter on this criterion,” not as “invert this query filter criterion.”

If you’re not convinced, then use radio buttons (or a dropdown list if space is tight): “Include only devices: ( ) With cooling, ( ) With or without cooling.”

If you wanted to include the option to filter on Without Cooling, then you must use radio buttons or a dropdown list: “Include only devices: ( ) With cooling, ( ) Without cooling.” Likewise, if you need to show more than two states, you must use radio buttons or a dropdown list: “Include only devices: ( ) With cooling, ( ) Without cooling,
( ) With or without cooling.”

You are correct that using a tri-state checkbox would be confusing. The mixed state is used to mean “some yes, some no” not “both yes and no.” Windows UX Interaction Guidelines specifically prohibit using the mixed state of the checkbox as a third state for a single item (you filter, in this case), or letting users select a mixed state (pg49).

In general it should be avoided.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文