08-10-2013 04:41 AM
Hello all,
I am using single column listbox to update some values to it progrmatically, when the values reaches to the end of the listbox vertical scrollbar appears , but to see the latest item added i need to move that scrollbar manually and this is causing problem as sometimes it become difficult to move the scrollbar manually, i want to know if there is any approach through which we dont need to move the scrollbar manually to see the latest item added, means scrollbar automatically mves up to show the latest item added.
Thanks
Solved! Go to Solution.
08-10-2013 05:40 AM
Hi,
could you describe the application with more detail? I may over simplify matters but would it be possible to just use "Insert Into Array" to insert new values to the top of listbox. See the attached example.
08-10-2013 06:15 AM - edited 08-10-2013 06:16 AM
Use TOP ROW property node of Listbox.
Edited: Example included.
08-10-2013 06:33 AM
Hello samli,
Thanks for the reply,In your vi you are using add button with event generated on it to add to the listbox now it will add only if we will press the button and only one item at a time and we dont want the new item at 0 index instead we want the new item to be at index where it should come bcs in our vi we are adding array of values not a single but what we want is to move that scrollbar automatically upwards when new item comes at end menas the whole list should automatically move upwards.
Attached below is the vi and the type of the seq. list which i need to upload.
08-10-2013 06:55 AM
Hello moderator 1983,
Thanks for the reply, i want the same output but one problem is there when i modified the program acc. to my need, as i am adding the whole array value the scrollbar moves very fast to the end although that is not a very big issue because in my original program this approach is working fine but in general i want to clearify this means even if i am increaing the delay to 5000 then also scrollbar moves very fast is increasing the delay to very large value the only solution to this problem or is there any other method also.
Below i am attaching the same vi snippet with little modification acc to my program
Thanks
08-10-2013 07:06 AM
@Ritu wrote:
when i modified the program acc. to my need, as i am adding the whole array value the scrollbar moves very fast to the end although that is not a very big issue because in my original program this approach is working fine but in general i want to clearify this means even if i am increaing the delay to 5000 then also scrollbar moves very fast is increasing the delay to very large value the only solution to this problem or is there any other method also.
Delay (and also loop) isn't required for your code, as you're updating the listbox after reading all the values (1D array) in a file...!!
Keeping your code in a loop (as demonstrated in the snippet, you shared)... It will read the same file again and again... also by increasing the delay, it will not help... as the logic here is, check the number of items to be written in the listbox if it is greater than the number of visible rows (in my example it was 20 rows), and based on the difference update the TOP ROW index (it starts with zero)...!! Even if there is no delay, as soon as LabVIEW will execute TOP ROW property node.. BOOM.... it will immediately set the TOP ROW... so there is no effect of delay...
If you want sort of anmation, you can choose to update the Listbox with single items, may be using a For loop (and not complete array in one go)...!!
Hope its clear to you...!!