From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Don't allow mouse wheel to scroll the vertical scrollbar after reaching the last element in array control

Solved!
Go to solution

Hi
I've an array control with some number of elements. When I scroll on array control, the vertical scroll bar keep on going and displaying the empty elements in the array. Is there any property available through which I can control the movement of scroll bar?
Attached image for reference.
2018-08-09_18h23_16.png
Thanks in advance!

0 Kudos
Message 1 of 12
(3,708 Views)

I suspect you will need to use a "Mouse scroll" event.

 

Inside the event you can get the control reference then use some property nodes from there.

 

You could take the array size and subtract the NumRows to get the highest allowable top index.

 

If the index you have attempted to scroll to is greater than the highest allowable, set it back to the highest allowable with another property node.

 

0xDEAD

0 Kudos
Message 2 of 12
(3,692 Views)
Solution
Accepted by PadmanabanJ

If your LV version supports the Mouse Wheel event, you can hook this event and correct the IndexVals property

mousewheel.png

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 3 of 12
(3,690 Views)
Solution
Accepted by PadmanabanJ

I Was thinking along same lines.

 

noscroll.png

0 Kudos
Message 4 of 12
(3,681 Views)

But I was a little bit lazier Smiley Happy

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 5 of 12
(3,668 Views)

I doubt you can properly catch\intervene that event. You'll always see flickering\artifacts.

 

I usually end up with a separate scrollbar and array. The separate scrollbar can be programmed with any max value and page length... A bit more work then desirable, but AFAIK the only way to do it right.

Message 6 of 12
(3,667 Views)

wiebe@CARYA wrote:

I doubt you can properly catch\intervene that event. You'll always see flickering\artifacts.

 

I usually end up with a separate scrollbar and array. The separate scrollbar can be programmed with any max value and page length... A bit more work then desirable, but AFAIK the only way to do it right.


Yes its a shame there is no filter event.

0 Kudos
Message 7 of 12
(3,654 Views)

@deceased wrote:

wiebe@CARYA wrote:

I doubt you can properly catch\intervene that event. You'll always see flickering\artifacts.

 

I usually end up with a separate scrollbar and array. The separate scrollbar can be programmed with any max value and page length... A bit more work then desirable, but AFAIK the only way to do it right.


Yes its a shame there is no filter event.


How about adding a pop-up ("at end of array stop scrolling!") then set the key focus to someplace else.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 8 of 12
(3,646 Views)

Thanks everyone.. This solution meets my requirement.
Thanks for your concern for flickering effect but it is not a big deal in my case 🙂 

0 Kudos
Message 9 of 12
(3,631 Views)

Interestingly, this doesn't work for array indicators.

 

When I had a look into the problem it seems that its a bug as discussed here:

https://forums.ni.com/t5/LabVIEW/mouse-scroll-array-indicators-bug-LAVA-x-post/td-p/3730630

 

Thought I would link it here in case anyone searches this in the future.

 

0xDEAD

0 Kudos
Message 10 of 12
(3,619 Views)