Showing results for 
Search instead for 
Did you mean: 

Retrieving position of scrollbar

Hi everyone,

I have a few applications that will present test result data in a multicolumn list box as the test progresses. The listbox is filled with values by a sub-vi using a reference to the listbox. Now what I'd like to do is to make sure that the focus on the listbox always is at the bottom, eg. the last values should be shown at the bottom of the list-box. However, I would also like to give the possiblity to scroll up to view the earlier values, without the program forcing the focus on the listbox to the end each time a new value is presented.

My idea of how to make this happen is to somehow always set focus on the last row in the listbox, except for when the "previousely last" row is not visible, which will happen when the user has scrolled up. When the user scrolls down to the end again, the program should continue showing the last values.

I think I can set focus on the last row, but how do I retrieve the information on the position of the scrollbar?

0 Kudos
Message 1 of 5
If you add the row value returned by the "Top Left Visable Cell" to the "NumRows", you can compare that value with the number of rows in the list box.

That will tell you if the last cell is visable.

I would like to suggest you add a seperate Boolean to control auto-scrolling.

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 2 of 5
Ben beat me to it, but here's my effort...
Message 3 of 5
Thank you both, you get my stars.

Obviousely that's the way to do it, fortunately i have control over the number of visible rows as well. Would be nice though if NI could insert a scrollbar property telling at least if it is at the top or at the bottom.

0 Kudos
Message 4 of 5
Cool - my first stars!

0 Kudos
Message 5 of 5