12-02-2012 08:57 PM
Hi, all
When I used the slide bar to control my device, I response the value change of slide bar and set the new value to my device. But it will generate response constantly when I use the mouse to drag the pointer, which is not my wanted. I just need to response only after the mouse released. How can I implement this function?
Hope your suggestion, thanks a lot.
Solved! Go to Solution.
12-02-2012 09:21 PM
Are you currently using a User Event structure? If not, use one and then create an event for your slider. Under the possible events you can choose, you will see "Mouse". Expand that and have a look.
12-02-2012 09:24 PM
Thanks for your reply.
Yes, I use the event structure now.
It will generate many events if I use the mouse to drag the pointer, which is not my need.
I only need 1 event after the mouse released.
12-02-2012 09:26 PM - edited 12-02-2012 09:29 PM
No, not if you use the right event under "Mouse".
12-02-2012 09:31 PM
Do you mean the event of "Mouse Up"?
I used this, but it will can not response the digital display value change of the slide bar.
12-02-2012 09:36 PM - edited 12-02-2012 09:37 PM
You said you were using the pointer to "drag" the slider...no mention of the digital display.
Do you mean you want this to work for either case of dragging the slider OR changing the digital display?
12-02-2012 09:40 PM
Yes, I just want to set a new value to my device when the slide bar value changed and I use both the dragging and digital display. But I don't want to change my device during the dragging.
12-02-2012 10:02 PM
There is no easy solution to that problem which has come up many times. Do some searches on the Forum.
Basically you must set a timer and watch to see if another event occurs within a small time. If it does, restart the timer and ignore the change. When the tims you specify has elapsed without a new value changed event, then accept the new value and pass it to whatever is using the data.
Lynn
12-02-2012 11:22 PM
Maybe there is no good solution about this question now.
Thanks.
12-02-2012 11:25 PM
Use 2 separate controls instead of showing the digital display on the slider.
For a mouse up event on the slider, update the value of the numeric control and do whatever it is you need to do.
For a value change on the numeric control, update the value of the slider and do whatever it is you need to do.