LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

List Box display to synchronize with Scroll bar.

I will like to know if anyone here can help to amend or advise on the attached VI in order to allow the List Box display to synchronize with the Scroll bar.
 
As the VI is in run mode, i would like to see 9.CD, 10.Troja, 11. Red... and so on to be displayed as it is being executed.
 
Thanks.
0 Kudos
Message 1 of 6
(4,397 Views)

There is no Text Scroll Position property like that of for a String. Smiley Sad

So, may not be possible to achieve it directly.

- Partha ( CLD until Oct 2027 🙂 )
0 Kudos
Message 2 of 6
(4,383 Views)
You can use TopRow property node. This will set row number currently at the top of the listbox.
 
best regards,
Andrey
 
0 Kudos
Message 3 of 6
(4,381 Views)
You can use the TopRow property, see the attached vi.

Hope this helps
David

Edit: As Andrey also said! - I should hit refresh before I reply Smiley Happy


Message Edited by DavidU on 06-25-2008 10:29 AM
Message 4 of 6
(4,378 Views)

Thank you Andrey and David for the reply and example too 🙂

I have also amended my earlier vi, so that other people can have a reference when they view this thread.

Smiley Very Happy

0 Kudos
Message 5 of 6
(4,353 Views)
Hi Gelb,

Glad to hear you've got it working Smiley Happy

I realised afterwards that my code will not work correctly if the last line is partially hidden, ie the list box does not display an exact number of lines. So I've added a +1 after the array size function to correct this, see attached vi.

You'll notice that I read the NumRows property of the listbox - I've done this so that if you decide to change the listbox height the code will still work without you having to go in and change anything. In your code you would have to change the constant (currently a 7) before the comparison primative to the new height. Also, in my new vi I've assumed the listbox height isn't going to change during the time it gets populated so I've move the NumRows property out of the for loop and read it only once - saves a bit of time

Using a for loop with auto indexing rather than a while loop also means that I don't need to index the input array every time or worry about when the loop will stop.

Hope this all helps

Dave


Message Edited by DavidU on 06-26-2008 08:59 AM
0 Kudos
Message 6 of 6
(4,337 Views)