LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to response the value change of slide bar only after mouse released

Solved!
Go to solution

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.

0 Kudos
Message 1 of 13
(3,216 Views)

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.

Message 2 of 13
(3,212 Views)

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.

0 Kudos
Message 3 of 13
(3,210 Views)

No, not if you use the right event under "Mouse".

 

Mouse Up.png

Message 4 of 13
(3,208 Views)

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.

0 Kudos
Message 5 of 13
(3,204 Views)

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?

0 Kudos
Message 6 of 13
(3,202 Views)

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.

 

 

0 Kudos
Message 7 of 13
(3,197 Views)

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

0 Kudos
Message 8 of 13
(3,189 Views)

Maybe there is no good solution about this question now.

 

Thanks.

0 Kudos
Message 9 of 13
(3,180 Views)
Solution
Accepted by Tom.Ba

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.

0 Kudos
Message 10 of 13
(3,177 Views)