为什么上的TrackBar值下降箭头向上/ PgUp键? [英] Why does the Trackbar value decrease on arrow up/PgUp?

查看:550
本文介绍了为什么上的TrackBar值下降箭头向上/ PgUp键?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我偶然发现在的TrackBar的WinForms控制一个有趣的现象。

I stumbled upon an interesting behavior in the Trackbar Winforms control.

在一个水平的TrackBar,左/右方向键按预期工作。 (向左箭头移动滑块向左并降低值,右箭头,则正好相反)
也可以操作使用上/下箭头键和上一页/下一页滑块。
但是,行为似乎违反直觉:向上箭头和向上翻页滑块移动到左侧,从而减小值。
向下箭头和向下翻页滑块向右移动,增加值。

On a horizontal trackbar, the left/right arrow keys work as expected. (Left arrow moves the slider to the left and decreases the value, right arrow does the opposite) It is also possible to manipulate the slider using the up/down arrow keys and PageUp/PageDown. However, the behavior seem counter-intuitive: arrow up and page up move the slider to the left and consequently decrease the value. Arrow down and page down move the slider to the right and increase the value.

在使用垂直的TrackBar,上/下键按预期工作,但箭头左=增加和右箭头=减少。

When using a vertical trackbar, up/down keys work as expected but arrow left = increase and arrow right = decrease.

这是显然是在本机Windows在C#的WinForms的默认行为,和。 (不知道后者,UAC滑块并以这种方式工作)

This is the default behavior in C# Winforms, and apparently in native Windows. (Not sure about the latter, the slider for UAC does work this way)

在WPF中的滑块控件作品正常,即与箭头向上的值增大,箭头向右UND PgUp键。
。在Internet Explorer隐私设置滑块正常工作。不知道为什么,但我怀疑按键的自定义操作。

In WPF the slider control works "properly" i.e. the value increases with arrow up, arrow right und PgUp. Also the slider in Internet Explorer Privacy settings works properly. Not sure why, but I suspect a custom handling of the keys.

从人体工程学的角度来看,很显然,上,右,前向和东西顺时针操作应该增加值。 (这什么新鲜事,比较的指南人因工程学,第二版第100页

From an ergonomics standpoint, it is clear that up, right, forward and clockwise manipulation of anything is supposed to increase the value. (This nothing new, compare A Guide to Human Factors and Ergonomics, Second Edition Page 100 )

现在到我的问题:有没有人知道为什么是这样的方式它是什么?

Now to my Question: Does anyone know why this is the way it is?

推荐答案

我强烈地倾向于认为之所以选择这种行为,以保持跟踪条控制与滚动条控制相一致。

I'm strongly inclined to think this behavior was chosen to keep the trackbar control consistent with the scrollbar control.

这两个控件有很多共同之处(拇指可以用行或网页的增量移动,这两个控件可以水平或垂直,既奠定了使用 WM_HSCROLL 并的 WM_VSCROLL 通知他们的父母当拇指位置的变化)。

These two controls have very much in common (their thumb can be moved by "line" or "page" increments, both controls can be laid out horizontally or vertically, both use WM_HSCROLL and WM_VSCROLL to notify their parent when the thumb position changes).

但从控制的角度来看,拇指可以移动向上或向下(分别是左或右)。用于滚动条的键盘导航<大骨节病>左和<大骨节病>最多为向上(向左)的运动,以及<大骨节病>右和<大骨节病>下为向下(向右)运动。

From the control's point of view, the thumb can move "up" or "down" ("left" or "right" respectively). The keyboard navigation for scrollbars used Left and Up for upwards (leftwards) movement, as well as Right and Down for downwards (rightwards) movement.

这一定是有意义的的TrackBar控制遵循相同的约定,因此使用到滚动条控件的实现开发人员可以将相同的原理到的TrackBar控制。

It must have made sense for the trackbar control to follow the same conventions, so developers used to the scrollbar control's implementation could apply the same principles to the trackbar control.

这篇关于为什么上的TrackBar值下降箭头向上/ PgUp键?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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