04-30-2025 10:09 AM - edited 04-30-2025 10:11 AM
Hello, I’m learning how to use an event structure to control a slider’s movement (up and down) with the mouse’s left and right buttons. Any guidance would be greatly appreciated!
Solved! Go to Solution.
04-30-2025 10:27 AM
Start with doing a "save for previous" (2019 or below) and attach again so more users can open your VI. (I currently cannot).
04-30-2025 11:16 AM
How about this?
04-30-2025 11:23 AM
@RTSLVU wrote:
How about this?
That's in 2023, but the OP was posting in 2021. Not sure if they can open this.
04-30-2025 11:38 AM
@altenbach wrote:
@RTSLVU wrote:
How about this?
That's in 2023, but the OP was posting in 2021. Not sure if they can open this.
Doh! Sorry here's a LV2019 version
04-30-2025 12:19 PM - edited 04-30-2025 12:19 PM
This is actually problematic, because any other mouse down (e.g. to operate another control in a larger app) will cause the slide to change (even pressing the stop button in this case!). An alternative would be to use a mouse-down on the slider, but then we need to deal with the right-click popup somehow.
One thing we might want to do is keep incrementing at a defined rate while one of the mouse buttons is held down. Here's a quick draft for that.
04-30-2025 04:00 PM - edited 04-30-2025 04:01 PM
Thank you for the help, this really clarified how to use event structures effectively. I was struggling to understand how to connect the slider to the event structure, so this example made a big difference. I like the idea of using the pane instead of only clicking on the slider because it prevents the pop up with the right click on the slider. Also the incrementing at a defined rate while the mouse button is held it’s a useful function I hadn’t thought of.
04-30-2025 06:18 PM
You really should modify it, for example you could configure the events so the increment/decrement only happens if you e.g. also hold down the shift or alt key when you press the mouse button. as I said if there are other controls, any mouse down on any other control would ALSO change the slider value.