UI Interest Group Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

How to programmatically adjust the scroll bar position on an array?

Solved!
Go to solution

I have a two-dimensional array on my front panel (pictured below). While my VI runs, the array populates with data as it comes in. One row is populated at a time, starting at the top row and moving down. The longer the VI runs the more rows get populated.

lv.PNG

Sometimes I scroll down and/or to the right with the scroll bars to see additional data. Then when I stop/start the VI, the scroll bar positions stay at the last left value (as shown above). Then as data comes in (starting with the top row) I can't see the first few rows of data since the array is scrolled so far down.

I want to program my VI to reset the scroll bar positions to view the top left (first row, first column) every time the VI starts running. But I can't figure out how. I don't see an array property that allows you to set the scroll bar position directly.  I've tried making the scrollbars invisible and then visible again to reset them. I've also tried making the array window display size 1x1 or 100x100 and then returning it to the previous value. But everything I try results in the scroll bars being in the same position they were at the start.

Can somebody help me?

0 Kudos
Message 1 of 4
(11,133 Views)
Solution
Accepted by topic author BenG.

Hi Ben,

usually this should be asked in the forum!

Use the "index values" property to set the index of the upper left array element...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 4
(8,390 Views)

BenG.

To programmatically position the scroll bar you have to use the "IndexVals" property node of the array. For a two-dimensional array you have to wire an array with a length of 2 into the Index Values property. For example, an array = {2, 3} would position the scroll bars so the second row and thrid column was the top left visible cell.

Hope this helps,

Rob

Message 3 of 4
(8,390 Views)

Thanks! This is exactly what I was looking for.

Sorry for posting in the wrong place.

0 Kudos
Message 4 of 4
(8,390 Views)