LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

how to make listbox to scroll auotmatically as list iems are added continuously

Hi All,

 

I want to to make listbox to scroll auotmatically as list iems are added continuously means if i add one list item it should become active and if i add second item it should become active and list box should scroll automatically to last element.I should be able to see that scrolling in UI.

 

I need this functionality to know at this point of time i am on which line in the list box.Please help me in this regard.

 

Thanks,

Harika

 

0 Kudos
Message 1 of 4
(3,753 Views)

I am not aware of a way to operate automatically this way: when I need such a functionality I simply add some line to my code:

 

InsertListItem (panel, control, -1, "text", value);

GetNumListItems (panel, control, &numItems);

SetCtrlIndex (panel, control, numitems - 1);

ProcessDrawEvents ();   // Optional, in case you do not process events other way in the code



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?
0 Kudos
Message 2 of 4
(3,752 Views)

Hi Robert,

 

I am using same way in my code. But what happening is : i am able to see the contents of the listbox only after inserting all the items.

 

For example, if i want to insert 100 items, list box is empty till all the 100 items are inserted.I am not able to see the listbox update for each item.After inserting 100 items,i am able to see the items.

 

whether i need to set any attributes????

 

Thanks,

Harika

0 Kudos
Message 3 of 4
(3,750 Views)
Are you processing at least draw events while you are adding elements to the listbox? If you aren't, then you won't see the listbox updating.


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?
0 Kudos
Message 4 of 4
(3,747 Views)