带有自定义刻度线文本的轨迹栏或滑块 [英] Trackbar or Slider with customized tickmark text

查看:102
本文介绍了带有自定义刻度线文本的轨迹栏或滑块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好-

我正在使用WinForms应用程序,并且希望有一个Trackbar/Slider控件,其中的刻度线旁边带有文本.对于最终用户而言,文本将不仅仅是标记或一些数字值,而是更加直观的文本.例如,在maps.bing.com上,他们在那里有一个带有街道/城市/国家/地区的滑块控件.

刻度和文本的数量取决于数据.可能是这样的:

Hi there -

I''m working on a WinForms app and would like to have a Trackbar/Slider control where the tickmarks have text next to them. The text would be more intuitive to the end user than just a mark or some numeric value. For instance, at maps.bing.com, they''ve got a slider control there that has street/city/country.

The number of ticks and the text is something that is data-dependent. Might be something like this:

<br />
- 1 Hour<br />
- 2 Hours<br />
- 6 Hours<br />
- 12 Hours<br />
- 1 Day<br />
- 1 Week<br />
- 1 Month<br />



我没看到任何人在做这样的事情,但我可能会错过它.

有想法吗?

谢谢,
Matt



I haven''t seen anyone doing anything like this, but I could have missed it.

Ideas?

Thanks,
Matt

推荐答案

我最终只是将标签控件放在需要文本的位置.我认为您不能在控件本身中标记刻度线,而不能用您自己的控件覆盖它们.

除此之外,您想要的标签并不意味着同一件事.轨迹栏控件上的刻度线是均匀分布的,并且表示同一事物中的一个或多个.您正在尝试混合使用小时,天,周和月以及恕我直言,这会给用户带来混乱的界面.
I ended up just putting label controls where I wanted text. I don''t think you can label the tick marks in the control itself without overriding it with your own control.

Beyond that, the labels you want don''t mean the same thing. The tick marks on a track bar control are evenly spaced and would indicate one or more of the same thing. You''re trying to mix hours, days, weeks and months, and IMHO, that would present a confusing interface to the user.


这篇关于带有自定义刻度线文本的轨迹栏或滑块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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