且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

轨迹栏停止滚动事件

更新时间:2023-12-06 14:26:22

您可以使用与我刚刚发现的类似的东西(在Google进行快速搜索!):
http://objectmix.com/javascript/352305-detecting-end-scroll.html [ ^ ]

注意:它是为网页滚动条编写的,但是很容易为跟踪条实现类似的概念.滚动跟踪栏时,将滚动设置为true并启动计时器.当计时器滴答时,检查旧的轨迹栏滚动位置是否与当前滚动位置相同,滚动= false并停止计时器.
You could use something similar to what I just found (in a quick google search!):
http://objectmix.com/javascript/352305-detecting-end-scroll.html[^]

Note: It''s written for a web page scroll bar but it would be easy to implement a similar concept for a track bar. When track bar is scrolled, set scrolling to true and start timer. When timer ticks check old trackbar scroll position against current one, if they are the same, scrolling = false and stop the timer.


不知道任何有关其个性的事件,但关于如何实现它的想法
我会叫您的跟踪栏,trackbar1

1.在您的主窗体类中的某个地方声明一个变量,例如:
Don''t know of any events for it personality but as an idea of how you could implement it
I''ll call your trackbar, trackbar1

1. Somewhere in your main form class declare a variable like:
int LastValue = trackbar1.Value;



2.双击轨迹栏的滚动事件,然后输入:



2. Double click on the scroll event for the Trackbar and write:

LastValue = trackbar1.Value;



3.双击滚动条的MouseUp事件.您应该添加一个if语句,如下所示,以检测它是否确实更改了跟踪栏的值.



3. Double click on the MouseUp event for the scroll bar. You should add an if statement as shown below to detect if it has actually changed track bar value.

private void trackbar1_MouseUp(object sender, MouseEventArgs e)
{
  if(trackbar1.Value != LastValue)
  {
    //TODO: Add code operations here
  }
}