LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Slide Control Value from Mouse Move Event

Hi everyone,

I’m using a Slide control in LabVIEW and I want to read its value when the user moves the mouse over it (using the Mouse Move event).

I’ve implemented it, but I see a deviation between the value I get during the Mouse Move event and the actual visible position of the slide.

Why does this deviation happen?

Thanks!

Download All
0 Kudos
Message 1 of 11
(237 Views)

Most here won't be able to open VIs saved in LabVIEW 2025. So a "save for previous (2020 or below) and attach again.

 

A mouse over event does not change the value of a control. If you are actually operating the slide, use a value change event instead. (make sure to limit the event queue to 1)

0 Kudos
Message 2 of 11
(224 Views)

LabVIEW 2016:

0 Kudos
Message 3 of 11
(212 Views)

(If you save the main VI for previous, it will drag all dependencies with it. If you rename the dependencies outside LabVIEW as you did, all dependencies are broken and need to be fixed manually. It is always super annoying if all front panels and diagrams are maximized to the screen.)

 

Can you explain the purpose of this entire convoluted exercise?

 

Basically, you are trying to get a precise floating point value out of something that is coerced to maybe 100 pixels.

At least also include a mouse-down event (which, on the scale, will change the value even if the mouse is not moved) and set the events not to lock the panel.

Your coordinates from the event terminal are from when the mouse was moved (possibly from a stale accumulated earlier event in the event queue), while the property node will read the value at the present time.

 

 

0 Kudos
Message 4 of 11
(203 Views)

Thanks for the detailed explanation!

The purpose of this exercise is that I want to read the value of a Slide control even when it is disabled or set as an indicator.
I’m trying to capture the value based on mouse position without needing user interaction (like a click).

Download All
0 Kudos
Message 5 of 11
(194 Views)

If it is disabled or an indicator, you cannot change the value and the code already knows what it is (it is in the wire!). An indicator is just a passive UI element and shows whatever is in the wire leading to it. 

 

Why do you even care about the mouse position? You could just use a "mouse-down" event and read the existing value from a local variables.

 

This entire exercise feels like a rabbit hole. 😄

0 Kudos
Message 6 of 11
(191 Views)

Thanks for the reply.

 

Let me clarify my goal:

 

I know that if the control is disabled or an indicator, I can’t change its value — and yes, the value is already available in the wire.

However, what I want is to get the value that corresponds to the mouse position over the Slide, even if the control is disabled or just an indicator.

 

In other words:

I want to treat the Slide as a “scale background,” and when the user hovers the mouse over it, I want to calculate what value the position would correspond to — without relying on the Slide’s actual value (because it’s not being changed by the user).

 

So I care about the mouse position because I want to map X/Y coordinates to a value along the slide scale, even if the control is passive.

 

It’s not about changing the Slide’s value — it’s about detecting where the mouse is and mapping that to the control’s scale.

 

Hope that makes more sense why I’m doing this.

0 Kudos
Message 7 of 11
(187 Views)

Just set the Tip Strip?

Yamaeda_0-1744634618313.png

 

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 8 of 11
(92 Views)

maxnoder1995_0-1744636006227.png

I have a Mouse Move event on a Slide, and I want to continuously get the value the Slide would take at the current mouse position, as if the user were to click there — even if they don't actually click.
So property like value can't help me.

0 Kudos
Message 9 of 11
(83 Views)

Hello Max, 

 

Best I could do is the following :

 

PinguX_0-1744637912459.png

 

 

As you may have noticed, there is no "Housing Position" property ... So you need to add this delta when calculating the relative position on the slide.

And since this delta is hard to measure, you will still have a delta between the measured and actual positions.

0 Kudos
Message 10 of 11
(72 Views)