LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Control Scrolling in Listbox

I have a listbox which displays data as it comes in from the serial port. Whenever new data comes in, the scrollbar is set to show the begining of the listbox. Is there anyway to set the position of this scrollbar?
0 Kudos
Message 1 of 12
(4,390 Views)
You can use the 'Top row' property of the listbox to set the first item visible.
In the example attached I add a line to a list box every .75 sec. The list box always shows the last line added and sets the cursor to a few lines before (so the cursos is always in the shown portion of the list box).
Hope this helps
Roberto


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 12
(4,389 Views)
brody wrote in message news:<506500000008000000C5360000-1007855737000@exchange.ni.com>...
> I have a listbox which displays data as it comes in from the serial
> port. Whenever new data comes in, the scrollbar is set to show the
> begining of the listbox. Is there anyway to set the position of this
> scrollbar?

Create a property node for the listbox and use the TopRow property.
0 Kudos
Message 3 of 12
(4,392 Views)
This program works fine in LAbview 6.
But is there also a solution for Labview 5.
0 Kudos
Message 4 of 12
(4,389 Views)
Is there a similar property for the multicoumn listbox??  I tried to find one similar because I want to do the exact same thing that you described, but with a multicolumn listbox.

Thanks.

Kenny
Kenny

0 Kudos
Message 5 of 12
(4,271 Views)
The property Top Left Visible Cell controls both vertical and horizontal scrolling.
0 Kudos
Message 6 of 12
(4,267 Views)
Dennis,

Thanks for the info.

 I was able to implement the listbox scrolling to the bottom along with the data aquisition in a standalone application, but I am having trouble getting it to function correctly in my program.   When I run my program, the scrollbar will go to the bottom, jump to the top and then jump to the bottom again, but then work fine after 25 iterations of the while loop.  Also, the data is displayed intermittently (cant see it, see it, cant see it) while this is happening (something to do with redrawing the listbox??).  I thought that maybe it was because the data was not being stored in my shift registers after the while loop ran, but it appears that that is not the problem (after running the probe).  This has happened (the scrollbar jumping) whether I use the Property "NumofRows" and wire that to the element build array or if I just wire the while loop count to the build array element or the current config (see pic) where I index the array to get the row value.

If the whole VI would help, I can post that too.

Kenny
Kenny

0 Kudos
Message 7 of 12
(4,248 Views)
I think I need to see the entire VI. When I create a while loop with just the shift register and top row logic, I get a smooth update and everything seems fine. I can't tell what you're doing in the rest of the program with the references, etc.
0 Kudos
Message 8 of 12
(4,244 Views)
Ok.  Here is everything.  Grab bar pc.vi is the mian VI.  You will be able to run it in aquire mode, but it will give you errors with nothing connected to it (the serial ports).
 
Thanks
 
Kenny
Kenny

0 Kudos
Message 9 of 12
(4,237 Views)
In your subVI call Mit Force Serail Write and Read, you're also changing the row property of the listbox. I'm not sure why you think you need to do this in both places. The row number is based on the iteration count of two separate while loops and not the actual number of rows in the listbox so my guess is that's why you're seeing the listbox jump around.
0 Kudos
Message 10 of 12
(4,232 Views)