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.
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.
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.
No, not if you use the right event under "Mouse".
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.
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?
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.
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.
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.