LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event Structure Help

Solved!
Go to solution

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!

0 Kudos
Message 1 of 8
(481 Views)

Start with doing a "save for previous" (2019 or below) and attach again so more users can open your VI. (I currently cannot).

0 Kudos
Message 2 of 8
(468 Views)

How about this?

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 3 of 8
(441 Views)

@RTSLVU wrote:

How about this?


That's in 2023, but the OP was posting in 2021. Not sure if they can open this.

0 Kudos
Message 4 of 8
(437 Views)
Solution
Accepted by topic author kyang11

 


@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

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 5 of 8
(426 Views)
Solution
Accepted by topic author kyang11

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.

 

altenbach_0-1746033526899.png

 

0 Kudos
Message 6 of 8
(405 Views)

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. 

0 Kudos
Message 7 of 8
(368 Views)

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.

0 Kudos
Message 8 of 8
(349 Views)